Now You Code 1: Exam Stats

Write a program to input exam scores (out of 100) until you enter 'quit'. After you finish entering exam scores the program will print out the average of all the exam scores.

HINTS:

  • To figure out the average you must keep a running total of exam scores and a count of the number of exam scores entered.
  • Try to make the program work 1 time, then figure out the exit condition and use a while True: indefinite loop.

Example Run:

Enter exam score or type 'quit': 100
Enter exam score or type 'quit': 100
Enter exam score or type 'quit': 50
Enter exam score or type 'quit': quit
Number of scores 3. Average is 83.33

Step 1: Problem Analysis

Inputs:

Outputs:

Algorithm (Steps in Program):


In [1]:
# Step 2: Write code here

Step 3: Questions

  1. What is the loop control variable in this program?

Answer:

  1. What is the exit or terminating condition of the loop in this program?

Answer:

  1. What happens when you enter an exam score outside the range of 0 to 100? Re-write your code to not accept exam scores outside this range.

Answer:

Step 4: Reflection

Reflect upon your experience completing this assignment. This should be a personal narrative, in your own voice, and cite specifics relevant to the activity as to help the grader understand how you arrived at the code you submitted. Things to consider touching upon: Elaborate on the process itself. Did your original problem analysis work as designed? How many iterations did you go through before you arrived at the solution? Where did you struggle along the way and how did you overcome it? What did you learn from completing the assignment? What do you need to work on to get better? What was most valuable and least valuable about this exercise? Do you have any suggestions for improvements?

To make a good reflection, you should journal your thoughts, questions and comments while you complete the exercise.

Keep your response to between 100 and 250 words.

--== Double-Click and Write Your Reflection Below Here ==--


In [ ]:
# RUN THIS CODE CELL TO TURN IN YOUR WORK!
from ist256.submission import Submission
Submission().submit()