Question: Create a Class named Operation. Create four instance variables num 1 , num 2 , Sum for addition, and Difference for subtraction. Then, create methods
Create a Class named Operation. Create four instance variables num num Sum for addition, and Difference for subtraction. Then, create methods for ComputeSum and ComputeDifference, create the set methods for num and num and get methods for Sum and Difference. The operation accepts two integers.
Operation
num: int
num: int
sum: int
difference: int
ComputeSum: void
ComputeDifference: void
set method for num and num
get method for sum and difference
optional:
displayResults
Create another class named OperationTest This class will read two integers. Define an object of type Operation. Compute and output the Sum and Difference using the method defined in the class Operation
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
