Question: 3. Construct a JavaConsole Program that reads in a list of integers, one per line, until a sentinel value of 0 (which you should be

 3. Construct a JavaConsole Program that reads in a list of

3. Construct a JavaConsole Program that reads in a list of integers, one per line, until a sentinel value of 0 (which you should be able to change easily to some other value). When the sentinel is read, your program should be able to display the largest and the smallest number in your console. Your code can also find the prime numbers. Print the number of prime numbers and display the total of prime numbers as well as illustrated in this sample run given below. Note: You are NOT allowed to use Math class methods or Arrays class. You MUST use any appropriate control statement. Your code must make sure the user key in minimum 2 integers to process if not request them to key in again. If the user enters the sentinel on the very first input line, then no values have been entered, and your program should display a message to that effect. Your output shall look like this: This program will acquire integer inputs and display the largest and smallest numbers and the number and summation of prime numbers. Type 0 to finish. ?23 ? 67 202 ? 45 ?16 20 Number of input values 5 Largest number 67 Smallest number 2 Number of prime number (5) = 2 Total of prime number (s) 90 = = = = (10 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!