Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Trace the use of the transaction log in database recovery.

Answered: 1 week ago

Question

Example 6. Find a general solution for y" + y = sint.

Answered: 1 week ago