Question: 5 . 1 6 ( Ch 5 ) LAB: Output stats on the values in a list Write a program that first gets a list

5.16(Ch 5) LAB: Output stats on the values in a list
Write a program that first gets a list of grades from input - all grades will be of the integer type. The input begins with an integer indicating the number of grades that follow. Then, output:
- the list of the grades,
- the average of the grades in the list, and
- all the grades below the average.
Note: your code must use for loops for reading input and grade filtering.
Ex: If the input is:
```
6
80
75
100
96
82
93
```
Then the output is:
```
The grades you input are [80,75,100,96,82,93].
The average of the grades is 87.67.
The grades below average are:
80
75
82
```
The 6 indicates that there are six grades to read, namely \(80,75,100,96,82,93\). The program must then:
build a list with those numbers,
- find and print the average of the grades in the list - print with two decimals
- iterate through the list to find and print the grades that are below the average calculated before.
You can assume that at least 1 grade will be provided.
Rubric:
5 . 1 6 ( Ch 5 ) LAB: Output stats on the values

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 Programming Questions!