Answer:
Step-by-step explanation:
Here is a Python program that incorporates conditional looping to average a given number of assignment grades for a student:
# Enter number of grades to process
num_grades = int(input("Enter the number of grades to process: "))
# Enter student name
student_name = input("Enter the student name: ")
# Initialize grade tally and loop counter
grade_tally = 0
counter = 0
# While loop to get grades and add them to grade tally
while counter < num_grades:
grade = int(input("Enter assignment grade: "))
grade_tally += grade
counter += 1
# Calculate student average
if num_grades > 0:
avg = grade_tally / num_grades
else:
avg = 0
# Display student average
print("The average grade for", student_name, "is", avg)
In this program, we first ask the user to enter the number of grades to process and the student name. We then use a while loop to get the specified number of grades and add them to the grade tally. After all grades have been processed, we calculate the student average by dividing the grade tally by the number of grades (if the number of grades is greater than 0). Finally, we display the student's name and average grade.