Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions