Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I know how to draw a UML by hand I just need help with the actual program Objects and Constructors Define a class of rectangles.

I know how to draw a UML by hand I just need help with the actual program image text in transcribed
Objects and Constructors Define a class of rectangles. Design a class named Rectangle to represent a rectangle. The class contains: Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1.0 for both width and height. A no-arg constructor that creates a default rectangle. A constructor that creates a rectangle with a specified width and height. A method named getArea0 that returns the area of a rectangle. > A method named getPerimeterO that returns the perimeter. Requirements: 1. Draw the UML of the Rectangle class. 2. Implement this class. 3. Write a test program with a main method that should do the following tasks: . Create the first rectangle using the no-arg constructor Create a second rectangle using the constructor's arguments to set the width to 4.0 and the height to 40.0. Print out the area of the first rectangle. Print out the perimeter of the second rectangle. Please note: You must finish this work by the end of the lab period. If you do not finish, please just submit what you have at the end of the lab. Submission: Submit the UML in a word or PDF file and program in a java file in folio using the dropbox folder Lab 9

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

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions

Question

=+-cach nonempty one contains a rational.

Answered: 1 week ago