Exercise 2: Write a java program that asks user to enter a set of positive integer values. When the user stops (think of sentinel value to stop), the program display the maximum value entered by the...


java


Exercise 2:<br>Write a java program that asks user to enter a set of positive integer values. When the<br>user stops (think of sentinel value to stop), the program display the maximum value<br>entered by the user. Your program should recognize if no value is entered without using<br>counter.<br>Sample run:<br>run:<br>Enter a positive integer or (-1) to stop: 25<br>Enter a positive integer or (-1) to stop: 36<br>Enter a positive integer or (-1) to stop: 51<br>Enter a positive integer or (-1) to stop: -9<br>Maximum number entered is: 51<br>BUILD SUCCESSFUL (total time: 8 seconds)<br>run:<br>Enter a positive integer or (-1) to stop: -10<br>NO number is entered!<br>BUILD SUCCESSFUL (total time: 2 seconds)<br>

Extracted text: Exercise 2: Write a java program that asks user to enter a set of positive integer values. When the user stops (think of sentinel value to stop), the program display the maximum value entered by the user. Your program should recognize if no value is entered without using counter. Sample run: run: Enter a positive integer or (-1) to stop: 25 Enter a positive integer or (-1) to stop: 36 Enter a positive integer or (-1) to stop: 51 Enter a positive integer or (-1) to stop: -9 Maximum number entered is: 51 BUILD SUCCESSFUL (total time: 8 seconds) run: Enter a positive integer or (-1) to stop: -10 NO number is entered! BUILD SUCCESSFUL (total time: 2 seconds)

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here