Write a program that that computes the maximum of two number

Write a program that that computes the maximum of two numbers. You need to follow the following instructions: Create a class called \"MaxProgram\". The class MaxProgram has only one method called \"maxValue\". This method takes two integer numbers as parameters. The method returns the maximum of the two numbers, else it returns -1, If both numbers are equal. To test this class, create another class called \"Tester\", with a main method. In the main method, create an object of the \"MaxProgram\" class. From the created object, call the \"maxValue\" method, and give it any two numbers. Print the returned maximum number.

Solution

Please find the required program along with its output. Please see the comments against each line to understand the step.

---------------------------------------------

OUTPUT:

maxValue = 34

 Write a program that that computes the maximum of two numbers. You need to follow the following instructions: Create a class called \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site