Question: 5. (4 pt) Convert the following program (including do-while loop) into an equivalent program that includes a while loop. 1 Scanner console = new Scanner(System.in);
5. (4 pt) Convert the following program (including do-while loop) into an equivalent program that includes a while loop. 1 Scanner console = new Scanner(System.in); String input; char sure; dot input = console.next(); sure = input.charAt(0); } while(sure != 'Y' && sure != 'N'); 6. (10 pt) Write a method, named minAndMax that accepts a Scanner object for the console as a parameter, prompts the user to enter a series of integers. The user should enter -999 to signal the end of the series (sen- tinel). After all the numbers have been entered, the method should display the smallest (minimum) and the largest (maximum) numbers entered and return the difference between maximum and minimum. If the user enter -999 as the first number, display "null" for maximum and minimum and return o. 7. (10 pt) Write a method called printPalindrome that accepts a string and then returns a boolean whether the argument is a case-insensitive palindrome (ie, reads the same forward as it does backward, like "abba" or "Racecar")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
