Question
Define a class named Square.java, using only the information provided in the UML class diagram shown here. *** In your class file, define only the
Define a class named Square.java, using only the information provided in the UML class diagram shown here.
*** In your class file, define only the instance variable shown in the diagram
*** Also, only define the methods listed above using the signatures provided and the body implied by each method signature.
Define a class name Quiz2Tester.java, which fully tests your class using a menu that allows the user to perform any of the following tasks:
1) Create a new Square object (using a default size of 10.0)
2) Change the side
3) Calculate and display the area
4) Calculate and display the perimeter
5) Display the current side
6) Exit
Make sure: (i) Follow program template guidelines for all required documentation and program description as output to the user.
(ii) Variable data types should be chosen according to the programs input and output data.
(iii) Copy and paste all of your screen output to the source code file as a comment block.
(iv) Be sure to display all numeric results using 2 dec place accuracy.
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