Question: Problem 5. (12 points) Write a Java program, to do the following tasks 1- Create two Rectangle objects with the following initial values a. Rectangle

 Problem 5. (12 points) Write a Java program, to do the

Problem 5. (12 points) Write a Java program, to do the following tasks 1- Create two Rectangle objects with the following initial values a. Rectangle 1: Position = (20,50) , (WH) = (15,20) b. Rectangle 1: Position-(60,30) , (WH) = (15.20) 2- Move the first rectangle 10 points left and 5 points down 3- Change the width of the first rectangle to half its initial width, and double its height, using corresponding public methods At the end of each of the following steps, test your program by printing the actual and expected results Note*: In this example, we just want to create Rectangle objects and not drawing them on the screen Problem 6. (12 points) Browse the Java API Documentation on Internet and try to find two classes, one for creating two- dimensional lines, and one for creating two-dimensional ellipses. Then, write a Java program, to do the following tasks 1- Create a line with the following initial values from the point (5, 10) to the point (20, 35) a. Change the end point of the line to (10,15) 2- Create an ellipse with the following initial values: Height-30, Width-50 The x coordinate of the upper-left corner of the framing rectangle of this ellipse The y coordinate of the upper-left corner of the framing rectangle of this ellipse- 15 At the end of each of the following steps, test your program by printing the actual and expected results Note*: In this example, we just want to create objects and not drawing them on the screen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!