Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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);

image text in transcribed
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

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

Step: 3

blur-text-image

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

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago