Menu

[solved]-1 Write Class Called Point Two Int Fields X Y Coordinates Class Necessary Accessors Mutato Q39079372

1. Write a class called Point that has two int fields x and y coordinates. The class should have the necessary accessors, mut1. Write a class called Point that has two int fields x and y coordinates. The class should have the necessary accessors, mutators, constructors, and toString methods. 2. Write another class called Circle that has 3 fields: a. a int fielded called circuit ID b. a double field called radius c. a Point object that stores coordinates of the central point of the circle. The class should have the necessary accessors, mutators, constructors, and toString methods The circuit I should be uniquely set (hint using class variables to help) in the constructors. In addition, add the following method to Circle class to draw itself on a graphics using the class DrawingPanel. public void draw (Graphics g) g setcolor (Color.red); e filloval(); /draw the circle; g.drawString (n.); write the circle ID closeby; 3. Write a class called Lab10, with main method. In the main method, create 3 Crdle objects, assign all the fields with random numbers; draw these circles on a Drawing Panel object. Show transcribed image text 1. Write a class called Point that has two int fields x and y coordinates. The class should have the necessary accessors, mutators, constructors, and toString methods. 2. Write another class called Circle that has 3 fields: a. a int fielded called circuit ID b. a double field called radius c. a Point object that stores coordinates of the central point of the circle. The class should have the necessary accessors, mutators, constructors, and toString methods The circuit I should be uniquely set (hint using class variables to help) in the constructors. In addition, add the following method to Circle class to draw itself on a graphics using the class DrawingPanel. public void draw (Graphics g) g setcolor (Color.red); e filloval(); /draw the circle; g.drawString (n.); write the circle ID closeby; 3. Write a class called Lab10, with main method. In the main method, create 3 Crdle objects, assign all the fields with random numbers; draw these circles on a Drawing Panel object.

Expert Answer


Answer to 1. Write a class called Point that has two int fields x and y coordinates. The class should have the necessary accessors… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *