Welcome

Please register to have access to more features!

It is highly recommended that you have Javascript enabled; many features will not work unless you do. The recommended browsers are Firefox and Chrome; the board is also NOT mobile-friendly.

Please invite your friends!

If you were referred by someone (ex. me, Jessica) please put their username in the referral box on the registration page. Ask them if you don't know their username.

If you are visiting for TESTING PURPOSES ONLY, this is the test account information:


Username:
Test
Password: test123



Select a forum to post in:

First Java application help

Anything to do with computers and how they work, send information, etc. Includes computer/programming languages such as HTML, C++, Java, etc

Moderators: Jessica, Teachers

First Java application help

Post Number: #1  Postby Jessica » January 17th, 2013, 7:31 pm

I really need help on this. I'm completely clueless :/

The Application:
Write a simple class called PointChecker that will
1) Declare a variable as a Point
2) Using the constructor that has two double parameters construct a point at location 93,67
3) Using the methods getX and getY and the System.out.print and println methods output the actual values that the created point contains
4) The output the expected values (what you expect to see)
5) Then using the translate method move the x coordinate 13 to the left (negative) and the Y value 7 down (positive).
6) Output values as described in steps 3 and 4


This is completely wrong, I know, but it's what I came up with. :/
Code: Select all
package course.jzc22.lab01;

public class PointTester {

   /**
    * @param args
    */
   public static void main(String[] args) {
      public int Point;
         double getX;
         double getY;
      public Point(X, Y); {
         X = getX;
         Y = getY;
      }
      Point myPoint = new Point (93, 67);
      System.out.println("Point");
   }

}
  • 0

User avatar
Jessica
Board Owner
Topic Author

Founder
Sapphire
Sapphire
 
8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership8 years of membership
 
Posts: 3,468
Topics: 1,244
Articles: 30
Joined: December 22nd, 2010, 8:04 pm
Local time: May 24th, 2019, 12:29 am
Last Visit: Yesterday, 11:49 pm
Location: Pennsylvania
Gender: Female
Cash on hand: 4,690.51
Bank: 138,647.08
Reputation: 148
Medals: 20
#1: July 2012 1st Place (1) R-Contest #1 First Place (1) Best staff member 2013 (1) Easter Egg Hunt 2013 (1) Graphic Drawing Participant (1) 1 Year (1) 2 Years (1) 3 Years (1) 4 Years (1) 5 Years (1)
6 Years (1) 7 Years (1) 8 Years (1) Founder (1) Highest Rep (1) Referrer (1) Top poster (1) Facebook group (1) Pin-Board (1) Article Author (1)
Referrals: 27
Blog: View Blog (471)
Subject(s): Chinese, Math
Global Moderator
Admin
Moderator

Return to Information Computer Technology (ICT)

Login  •  Register
cron
Reputation System ©'