Anbspcreate a class named numbers whorsquos main method


A.

  • Create a class named Numbers who’s Main () method holds two integer variables. Assign values to the variables. Within the class, create two methods, Sum () and Difference (), that compute the sum of and difference between the values of the two variables, respectively. Each method should perform the computation and display the results. In turn, call each of the two methods from Main (), passing the values of the two integer variables.
  • Add a method named Product () to the Numbers class. This method should compute the multiplication product of two integers, but do not display the answer. Instead, it should return the answer to the calling Main () method, which displays the answer.

B.

 

  • Create a class named Square. In the Main () method, declare an integer and prompt the user for a value. Display the value of the integer, then pass it to a method that accepts the value as a reference parameter and prints its square (the number times itself). In Main (), print the value again, proving that the original argument to the method was altered. 

Request for Solution File

Ask an Expert for Answer!!
Finance Basics: Anbspcreate a class named numbers whorsquos main method
Reference No:- TGS01093440

Expected delivery within 24 Hours