Question: Write codes that will take in 2 integer values and display the bigger of the 2 numbers. The program should also display relevant message when
Write codes that will take in 2 integer values and display the bigger of the 2 numbers. The program should also display relevant message when the 2 numbers are equal. a) Write the function getInput as follows: The function takes in a String parameter that will be used as part of the input dialog prompt, e.g. "Please enter 1st integer" and "Please enter 2nd integer". It returns an integer value corresponding to the user input. values. b) Write a function findMax that takes in 2 integer values num1 and num2. It compares which number is bigger and returns one of the following string values: "1st number is bigger" "2nd number is bigger" "The 2 numbers are equal" c) In your main code, invoke getinput("1st") and getInput("2nd") to get the values of num1 and num2. Invoke findMax and display the string returned
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
