So the question is a 2 parter. I believe I have the part a completed right, but not 100% where to add in the second part. The first question is as follows:
A. Create an application named Numbers whose main() method hold two integer
variables. Assign values to the variables. Pass both variables to methods named
sum() and difference(). Create the methods sum() and difference(); they compute the sum of and difference between the values of two arguments, respectively. Each method should perform
the appropriate computation and display the results.
My answer is:
void sum(num n1,num n2)
output "The sums of",n1, "and",n2, "is", result
void difference(num n1,num n2)
output "The difference of",n1, "and",n2, "is", result
The question for b is:
B. Add a method named product() to the Numbers class. The product() method should compute the multiplication product of two integers, but not display the answer. Instead, it should return the answer to the calling method, which displays the answer.
The instructor suggested that a case structure may help.