I am a very beginning programmer, and I am trying to create a grade book program for a professor at a university, so that he may input his midterm and final exam scores and get an average and letter grade for each student per course. The program is supposed to get input for the Course Number, Course Level, Number of Exams, and Student info (ID and exam scores).
At first I was thinking to create a dictionary with the ID as the key and the average as the value, but then that just didn't seem to work, so I started to try and create while loops with conditional.
Basically the code is a mess, and I am not exactly sure what I am doing wrong. I have watched tutorials and read a ton of things online, but I'm hitting a brick wall with this. For one thing I keep getting an Invalid Syntax error on line 22 with the elif statement. Any help anyone can give with this would be really appreciated! Apologies in advance for anything I am leaving out here - I am new to all this.
Thank you!
print("Hello! Welcome to your Grading Program!\n")
courseCode = input("Please enter the course code : ")
courseLevel = input("Please enter the course level : ")
numberExams = float(input("Please enter the number of exams : "))
enterStudents = input("Would you like to input a student, Yes or No? : ")
student = 0
while enterStudents == "Yes" or "yes" or "y" or "Y" :
if courseLevel == "undergrad" or "Undergrad" or "undergraduate" or "u" or "U":
for student in range(int(numberExams)):
ID = input("Please enter student ID: ")
midterm = int(float(input("Please enter midterm score: ")))
finalExam = int(float(input("Please enter final exam score: ")))
undAverage = (midterm * .60) + (finalExam * .40)
elif courseLevel == "grad" or "Grad" or "Graduate" or "g" or "G":
for student in range(int(numberExams)):
ID = input("Please enter student ID: ")
midterm = int(float(input("Please enter midterm score: ")))
finalExam = int(float(input("Please enter final exam score: ")))
undAverage = (midterm * .30) + (finalExam * .70)
elif enterStudents == "No" or "no" or "n" or "N" :
print("\nSee you next time!")
else:
enterStudents == "" :
input("Invalid Entry! Would you like to input a student, Yes or No?:")
def Grade():
for letter in Grade:
total = 100
for letter in Grade(A,B,C,D,E,F):
if undGrade == "A":
undAverage >= range(85,101)
elif undGrade == "B":
undAverage >= range(70,85)
elif undGrade == "C":
undAverage >= range(55,70)
elif undGrade == "D":
undAverage >= range(40,55)
elif undGrade == "F":
undAverage >= range(0,40)
print(Grade)