Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java Please. - Complete the following programming assignment: A. Design & implement a class called Point that represents a location in the Cartesian plane.

image text in transcribedimage text in transcribed

In Java Please.

- Complete the following programming assignment: A. Design \& implement a class called Point that represents a location in the Cartesian plane. B. Include (at a minimum) the following methods: I. setX( double x ), setY (double y ), setPoint(double x, double y ) - set the coordinates of the point. II. shift X (double n ), shift Y (double n ) - shift a point by a given amount along one of the axes. III. distance(Point p2) - finds the distance to point p2. IV. rotate(double angle) - rotates the point by a specified angle around the origin. The formula for rotation is as follows: x=xcos()ysin()y=xsin()+ycos() Any other methods you believe to be necessary. - Your code should work with the driver class provided (Project1.java). - Use the driver with no code modifications to test your class for the correct results. - Use the informal UML below to complete your Point class. Once you get your Point class working, when you run the driver, you should see something similar to the following: Project 1 : Point Tester Point 1: Point {x=3.0,y=1.0} Point 2: Point {x=6.0,y=5.0} Distance: 5.0 Rotated a 1.5707963267948966: Point {x=0.9999999999999998,y=3.0} Shifted b 4.47213595499958 away from original position: Point {x=10.0,y=3.0}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions