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
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: 49Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started