Question: OBJECT ORIENTED PROGRAMMING LESSON LABORATORY EXERCISE - 9 Problem: Create the class on the UML class diagram. table [ [ Calculator ] , [
OBJECT ORIENTED PROGRAMMING LESSON
LABORATORY EXERCISE
Problem: Create the class on the UML class diagram.
tableCalculatortable brand: String digits: finaltableAt adddouble double doublesubtractdouble double coublemultiplydouble double doubledividedouble double double
Write Calculator class according to UML Class diagram.
Create a constructor for the class.
Encapsulate brand and create getter and setter.
Place toString method in the class.
Obtain the methods as "static":
Obtain the digits property as final and
Create your application.
Inside the application call static methods of Calculator to make some calculations. Numbers will be user enterance
If user wants to make calculations then application should continue if not it should end.
For example: To make calculation Exit:
If then
Choose operation Add, Multiply, Subtract, Division
If then
Enter first number:
Enter second number:
The result is:
When user wants to exit then show brand and digits properties.
For example: The program has been ended, brandSamsung, digits
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
