Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help finishing this _class.docx ZOOM private double x private double y publie void setx (double xl) public void sety (double yi) public double

image text in transcribed

I need help finishing this

_class.docx ZOOM private double x private double y publie void setx (double xl) public void sety (double yi) public double getx () Assi EGR 140: Computer Programming l) (return x:1 public double gety(l rreturn y Assigned: Monday, 30 October 2017 Due Friday, 3 November 2017 (elass time) Points: 20 publie void set (double xl, double yl) System. out.print ( "Carresian Coordiances:"x+ Write an error-free Java program to do the following things class .Write a class called "Vec2D The class has (at least) two private data members which correspond to the x and y coordinates of a 2D vector. class( The class Vee2D should have several (methods) functions set the coordinates, display the vector in Cartesian (x y) format, and display the vector in polar (t, theta) format public clasa Assignnent 13 publid tapie void main (Scringllara) The man program should declare two objects of type Vec2D. It should set the coordinates of the first object to length 5, angle the coordinates of the second object to x 5 (that is, polar ccordanates) and 4 5, y = 10 (Cartesian coordinates) EGR vec2D objecti + ney Vec2Dn vec2D object2 , new veo2D() ; .The main program should then parint object 1 in a Cartesian (x,y) fermat and polar format meth (wth theta in degrees) and object 2 in Cartesian and polar format. Good progamming design is to make your objects and methods general in order to be used in muliple contexts. Thus, wrte your code so that the printin) statements aze un the main) module and it calls method s) for v1 and v2 to access the data object 1 .3tx(5) meth noted Outpu note 6'6'+6.. v : x = 4.045084971674737 y 2.93892 6241462 366 print v2:x4.500000000000001 y 10.0 6'6' .6"v2: 10-9E5a5ED 997 30654 th 65.-7225468204583 Remember to put the usual header at the top of the program and to submnit via Canv as. Comple MessagesGRASP Messages Run O Interactions Find Workbe

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_2

Step: 3

blur-text-image_3

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

Database Technology And Management Computers And Information Processing Systems For Business

Authors: Robert C. Goldstein

1st Edition

0471887374, 978-0471887379

More Books

Students also viewed these Databases questions

Question

Have ground rules been established for the team?

Answered: 1 week ago

Question

Is how things are said consistent with what is said?

Answered: 1 week ago

Question

Do you currently have a team agreement?

Answered: 1 week ago