Program Description Assignment 2 Construction Program Reads Unspecified Number Integers St Q43862413
Program Description
Assignment #2 will be the construction of a program that readsin an unspecified number of integers from standard input, performssome calculations on the inputted numbers, and outputs the resultsof those calculations to standard output. The numbers could bedelimited by any kind of whitespace, i.e. tabs, spaces, and lines(Note that if you use the Scanner class, you do not have to worryabout these delimiters. They will be taken care of).
The use of the following items, discussed in class, willprobably be needed:
Documentation
Primitive Data Types
Basic I/O
Expressions
Conditional and Loop statements
Your program will continue to read in numbers until thenumber 0 is entered. At this point, the calculations willbe outputted in the following format:
The minimum integer is 0
The count of odd integers in the sequence is 0
The largest even integer in the sequence is 0
The sum of positive integers is 0
This means that using all numbers your program reads (includingthe last number 0), you need to compute the minimum, count how manyodd integers (cannot be divided by 2, “num%2 != 0”), compute thelargest even integer (can be divided by 2, “num%2 == 0”), andcompute the sum of positive integers.
Note that the above is an output for the first test case. Forother test cases, you will have different numbers.
Do not prompt to query for the numbers. Thenumber 0 is included in the sequence of integers and should beincluded in all of your calculations.
Try the following input cases to see if you get the correctoutput.
Input #1: 0
Output #1:
The minimum integer is 0
The count of odd integers in the sequence is 0
The largest even integer in the sequence is 0
The sum of positive integers is 0
Input #2: -1, 2, 0
Output #2:
The minimum integer is -1
The count of odd integers in the sequence is 1
The largest even integer in the sequence is 2
The sum of positive integers is 2
Input #3: -1, -2, -45, -90, 1.23, 679, 90, 0
Output #3:
The minimum integer is -90
The count of odd integers in the sequence is 5
The largest even integer in the sequence is 90
The sum of positive integers is 793
Input #4: 4, -3, 0, -1, 2
Output #4:
The minimum integer is -3
The count of odd integers in the sequence is 1
The largest even integer in the sequence is 4
The sum of positive integers is 4
Expert Answer
Answer to Program Description Assignment #2 will be the construction of a program that reads in an unspecified number of integers …
OR