Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Perform the indicated problem statement below. 1. Make a main class and name it Geometry. Under the main method, output your complete full name and

Perform the indicated problem statement below.

1. Make a main class and name it Geometry. Under the main method, output your complete full name and ID number.

2. Make a superclass under Geometry and name it Shapes. Make a subclass/child class of Shapes class and name it Rectangle.

3. Inside the Shapes class, create three void methods namely, the width, length and perimeter. Output any related text in each method.

4. In Rectangle class, declare three variables named as width, length and perimeter with an integer datatype.

5. Prompt the user to input a value for the width.

6. Initialize value for the length with the last two digits of your I.D. Number.

7. Under the Rectangle class, create four void methods namely intro, width, length and perimeter.

8. The other three methods will override the methods in the Shapes class.

9. The intro method will output the word Rectangle.

10. Width method will output the inputted value of the width by the user, length method will output initialized value for the length and perimeter method will output the calculated result of the perimeter of a rectangle formula using the values of the width and length.

Sample Output When Run

: image text in transcribed

11. Draw the corresponding complete UML Class diagram of the program above.

Output - Geometry (run) run: o Name: Kimberly Nepa ID Number: 123456 OR Width of the shape here. Length of the shape heze. Perimeter of the shape here. Rectangle Width of the Rectangle is: 23 Length of the Rectangle is: 56 Perimeter of the Rectangle is: 644 BUILD SUCCESSFUL (total time: 0 seconds)

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

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students also viewed these Databases questions

Question

LO5 Highlight five external recruiting sources.

Answered: 1 week ago