Starting from:

$30

IT244-Iteration Solved


## Assignment Requirements 

Write a Python program that will incorporate conditional looping to average a given number of assignment grades for a student. The program will calculate and display the average.


## Assignment Instructions

  1. Initialize variables as needed (i.e., numGrades = 0). 

    - *Reference*: Refer back to Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Booleans.

2. Prompt the user to input the number of grades to be processed. Store this value in a variable (i.e., numGrades).

    - *Hint*: This value will determine how many repetitions are performed.

    - Reference: Refer back to your Unit 1 readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 3: Built-In Functions / Getting Input From the User.

3. Prompt the user to enter a student name. Store that name in a variable (i.e., studentName).

4. Create a conditional loop and continue processing grade values for this student until the given number of assignments have been processed.

    - **Within this loop**:
        - Prompt to get a numeric grade value from the user.
        - Add that grade to a numeric variable to keep a tally of the grades. Each time through the loop (for a given student), a new grade value will be entered and added to this tally.
        - Increment the loop counter.

    - *Reference*: Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 6: Loops / The While Statement / Increment and Decrement

5. Once grades for the conditional loop have been entered, average the grades using the total tally divided by the number of grades to be entered given at the start of the program. Store the average in a variable (i.e., studentAverage).

    - *Reference*: Refer back to your Unit 2 readings in Learn to Program With Python 3: A Step-by-Step Guide to Programming, 2nd edition, Chapter 2: Simple Math.

6. Display the name of the student and their average.



More products