Question: Create a constructor class Add that has public integer variables num 1 and num 2 . Include a default constructor and a void method Addition

Create a constructor class Add that has public integer variables num1 and num2. Include a default
constructor and a void method Addition that accepts the two integer parameters, calculates and outputs
the addition.
In your main class Calculate include a main method that prompts the user to enter 2 integer values and
create a reference called answer for the constructor Add. Output the values entered by the user and the
result of the addition in the command line window.
Example
Input =10,5
Output|example
----jGRASP exec: java Calculate
The answer is: 15
First number =10
Second number =5
----jGRASP: operation complete.
 Create a constructor class Add that has public integer variables num1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!