Final answer:
The question is about creating a Python program that can calculate both the highest and the average grades for a class, and list the students who achieved the highest grade.
Step-by-step explanation:
Python Program for Calculating Midterm Grades
Dr. Smith needs a program to calculate the highest and average grades for IT 103, and identify the students with the highest grade. Below is a simple Python script for this purpose:
students_grades = {}
highest_grade = 0
while True:
name = input("Enter student name (or 'stop' to finish): ")
if name == 'stop':
break
grade = float(input("Enter grade for " + name + ": "))
students_grades[name] = grade
if grade > highest_grade:
highest_grade = grade
average_grade = sum(students_grades.values()) / len(students_grades)
top_students = [name for name, grade in students_grades.items() if grade == highest_grade]
print("The highest grade is:", highest_grade)
print("The average grade is:", average_grade)
print("Students with the highest grade:", top_students)
This program prompts Dr. Smith to input student names and their grades continuously until 'stop' is entered. It calculates both the average and the highest grades, and stores the names of the students who achieved the highest grade, which are printed at the end.