Question: Write a java class that takes two integer numbers as input and performs each of the following operations. Write separate methods for each of the

Write a java class that takes two integer numbers as input and performs each of the following operations. Write separate methods for each of the operations.

1. main: this method should take user inputs for two integers and display the result as shown below.

2. addition: this method should perform addition functionality. This method should accept two integers as parameters and have integer as return type.

3. subtraction: this method should perform subtraction functionality. This method should accept two integers as parameters and have integer as return type.

4. multiplication: this method should perform multiplication functionality. This method should accept two integers as parameters and have integer as return type.

5. division: this method should perform division functionality. This method should accept two integers as parameters and have floating number as return type. You must return all decimal places.

6. remainder: this method should perform calculation to return remainder when two numbers are divided. This method should accept two integers as parameters and have integer as return type.

7. square: this method should perform calculation to return square of a number. This method should accept one integer as parameter and have integer as return type.

Your output should look similar to the one shown

Write a java class that takes two integer numbers as input and

Enter the first number: 15 Enter the second number 7 The sum of two numbers is: 22 The difference of two numbers is: 8 The product of two numbers is: 105 The divison of two numbers is: 2.142857 The remainder for the division of two numbers is: 1 The square of the first number is: 225 The square of the second number is: 49

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!