Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

CmpSc131, Summer 2022

Final Lab: Enter Valid Grades



· This lab will test your ability to use either a FOR loop or a WHILE loop, whichever works best for the following lab.

· Place a comment header at the top of the python code.

· Submit the code to the appropriate Canvas lab assignment.

· Please to not plagiarize (cheat, copy someone’s program).

· Your python final lab must be submitted no late than Tuesday, Jul 9, 2022 by 4:30pm.  After that, the submission, for the lab, will be closed.

Requirements

1. Name the python file Final_EnteringGrades.

2. Input: Have the program loop and keep asking the user to input a valid test scores.  A valid score is between 0-100 (integer).

3. If the input is valid, keep a total of all the grades and the number of valid grades entered.

4. Tip: No need to store the grades in a List, as long as you keep a running total.

5. If the input is not valid, display an error message and do not accept the invalid input.

6. The user will stop entering grades when they type an exit value of (-1).

7. When inside the loop, keep track of the maximum and minimum grades.

8. The while statement must have a meaningful test (not just “while (True)” or something like that).

9. Do not use break, continue, or exit()

10. Have only one input() function call, in the program.

11. When “-1” is entered, display the message “finished receiving grades”.

a. an error msg should not appear.

12. After exiting the input loop, calculate the average grade, (floating point value),  

a. Remember to test for divide by zero.

13. Output

a. Display the maximum, minimum values, and average grades, and number of grades.

b. Place 2 blank lines between the input and the output.

c. Line up all of the output data, similar to what's below.

i. Number of grades:   12

ii. Average grades:     95.64 etc.

Coding Style Requirements

1. These guidelines will be part of the grading rubric.

2. Add a comment header at the top of the python program stating your name, the course number, the semester, and a one line description about the program

3. DO NOT break out of any WHILE or FOR loop.  Use a legitimate test to get out of the loop.

4. Use meaningful variable names.

5. Place spaces around any operators, as described below

a. if (a != b) and (c > 100):

b. while (gr != -1):

6. Place a blank line about all While, For, IF, Elif, else statements.