Final answer:
To write a program that prompts the instructor to enter the students' names and calculate average grades for each student, use a loop to iterate through the number of students. Prompt the user for the student's name and grades, and calculate the average grade. Print the student's name, grades, and average grade.
Step-by-step explanation:
To write a program that prompts the instructor to enter the students' names and the number of average grades to calculate for each student, you can use a loop to iterate through the number of students. Within each iteration, prompt the user to enter the student's name and grades. Calculate the average grade by summing up the grades and dividing by the number of grades. Finally, display the student's name, the grades entered, and the average grade.
Here's an example in Python:
num_students = int(input('Enter the number of students: '))
for i in range(num_students):
name = input('Enter the student name: ')
grades = []
for j in range(3):
grade = float(input(f'Enter grade {j+1} for {name}: '))
grades.append(grade)
average_grade = sum(grades) / len(grades)
print(f'Student Name: {name}')
print(f'Grades Entered: {grades}')
print(f'Average Grade: {average_grade}')
print() # Blank line