Question: Program 4: Design (pseudocode) and implement (source code) a program (name it LargestoccurenceCount) that read from the user positive non-zero integer values, finds the largest
Program 4: Design (pseudocode) and implement (source code) a program (name it LargestoccurenceCount) that read from the user positive non-zero integer values, finds the largest value, and counts it occurrences. Assume that the input ends with number 0 (as sentinel value to stop the loop). The program should ignore any negative input and should continue to read user inputs until O is entered. The program should display inputted values (valid ones only) followed by the largest value and number of times it appeared as shown below in this sample runs. Document your code and properly label the input prompts and the outputs as shown below Sample run 1: Enter positive integers (0 to quit): 3 4 5-94 25 1-5 250 Valid inputs: 345 4251 2 5 Largest value: 5 Occurrences: 3 times Sample run 2: Enter positive integers (0 to quit): 3 7 5-44 2-55170 Valid inputs: 3 7542 5 1 7 Largest value: 7 Occurrences: 2 times Sample run 3: Enter positive integers (0 to quit): 2 9 8 -489-58917790 Valid inputs: 298898 91779 Largest value: 9 occurrences: 4 times
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
