Question
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
:
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started