Crosswords2 mins ago
I Need Help Coding
12 Answers
I have a mostly finished grade calculator that needs help getting finished up and the syntax errors being worked out. It is written in python 3:
studentGradeMath = input("Enter student letter grade for Math - ").upper()
studentGradeWriting = input("Enter student letter grade for Writing - ").upper()
studentGradeReading = input("Enter student letter grade for Reading- ").upper()
studentGradeAttendance = input("Enter student letter grade for Attendance- ").upper()
studentGradeHistory = input("Enter student letter grade for History - ").upper()
if studentGradeMath == "A":
print("4")
elif studentGradeMath == "A-":
print("3.5")
elif studentGradeMath == "B":
print("3")
elif studentGradeMath == "B-":
print("2.5")
elif studentGradeMath == "C":
print("2")
elif studentGradeMath == "C-":
print("1.5")
elif studentGradeMath == "D":
print("1")
elif studentGradeMath == "D-":
print("0.5")
else studentGradeMath == "F":
print("0")
if studentGradeWriting == "A":
print("4")
elif studentGradeWriting == "A-":
print("3.5")
elif studentGradeWriting == "B":
print("3")
elif studentGradeWriting == "B-":
print("2.5")
elif studentGradeWriting == "C":
print("2")
elif studentGradeWriting == "C-":
print("1.5")
elif studentGradeWriting == "D":
print("1")
elif studentGradeWriting == "D-":
print("0.5")
else studentGradeWriting == "F":
print("0")
if studentGradeHistory == "A":
print("4")
elif studentGradeHistory == "A-":
print("3.5")
elif studentGradeHistory== "B":
print("3")
elif studentGradeHistory == "B-":
print("2.5")
elif studentGradeHistory == "C":
print("2")
elif studentGradeHistory == "C-":
print("1.5")
elif studentGradeHistory == "D":
print("1")
elif studentGradeHistory == "D-":
print("0.5")
else studentGradeHistory == "F":
print("0")
if studentGradeAttendance == "A":
print("4")
elif studentGradeAttendance == "A-":
print("3.5")
elif studentGradeAttendance == "B":
print("3")
elif studentGradeAttendance == "B-":
print("2.5")
elif studentGradeAttendance == "C":
print("2")
elif studentGradeAttendance == "C-":
print("1.5")
elif studentGradeAttendance == "D":
print("1")
elif studentGradeAttendance == "D-":
print("0.5")
else studentGradeAttendance == "F":
print("0")
if studentGradeReading == "A":
print("4")
elif studentGradeReading == "A-":
print("3.5")
elif studentGradeReading == "B":
print("3")
elif studentGradeReading == "B-":
print("2.5")
elif studentGradeReading == "C":
print("2")
elif studentGradeReading == "C-":
print("1.5")
elif studentGradeReading == "D":
print("1")
elif studentGradeReading == "D-":
print("0.5")
else studentGradeReading == "F":
print("0")
studentGradeMath = input("Enter student letter grade for Math - ").upper()
studentGradeWriting = input("Enter student letter grade for Writing - ").upper()
studentGradeReading = input("Enter student letter grade for Reading- ").upper()
studentGradeAttendance = input("Enter student letter grade for Attendance- ").upper()
studentGradeHistory = input("Enter student letter grade for History - ").upper()
if studentGradeMath == "A":
print("4")
elif studentGradeMath == "A-":
print("3.5")
elif studentGradeMath == "B":
print("3")
elif studentGradeMath == "B-":
print("2.5")
elif studentGradeMath == "C":
print("2")
elif studentGradeMath == "C-":
print("1.5")
elif studentGradeMath == "D":
print("1")
elif studentGradeMath == "D-":
print("0.5")
else studentGradeMath == "F":
print("0")
if studentGradeWriting == "A":
print("4")
elif studentGradeWriting == "A-":
print("3.5")
elif studentGradeWriting == "B":
print("3")
elif studentGradeWriting == "B-":
print("2.5")
elif studentGradeWriting == "C":
print("2")
elif studentGradeWriting == "C-":
print("1.5")
elif studentGradeWriting == "D":
print("1")
elif studentGradeWriting == "D-":
print("0.5")
else studentGradeWriting == "F":
print("0")
if studentGradeHistory == "A":
print("4")
elif studentGradeHistory == "A-":
print("3.5")
elif studentGradeHistory== "B":
print("3")
elif studentGradeHistory == "B-":
print("2.5")
elif studentGradeHistory == "C":
print("2")
elif studentGradeHistory == "C-":
print("1.5")
elif studentGradeHistory == "D":
print("1")
elif studentGradeHistory == "D-":
print("0.5")
else studentGradeHistory == "F":
print("0")
if studentGradeAttendance == "A":
print("4")
elif studentGradeAttendance == "A-":
print("3.5")
elif studentGradeAttendance == "B":
print("3")
elif studentGradeAttendance == "B-":
print("2.5")
elif studentGradeAttendance == "C":
print("2")
elif studentGradeAttendance == "C-":
print("1.5")
elif studentGradeAttendance == "D":
print("1")
elif studentGradeAttendance == "D-":
print("0.5")
else studentGradeAttendance == "F":
print("0")
if studentGradeReading == "A":
print("4")
elif studentGradeReading == "A-":
print("3.5")
elif studentGradeReading == "B":
print("3")
elif studentGradeReading == "B-":
print("2.5")
elif studentGradeReading == "C":
print("2")
elif studentGradeReading == "C-":
print("1.5")
elif studentGradeReading == "D":
print("1")
elif studentGradeReading == "D-":
print("0.5")
else studentGradeReading == "F":
print("0")
Answers
if studentGrade Math == "A": print("4") elif studentGrade Math == "A-": print("3.5") elif studentGrade Math == "B": print("3") elif studentGrade Math == "B-": print("2.5") elif studentGrade Math == "C": print("2") elif studentGrade Math == "C-": print("1.5") elif studentGrade Math == "D": print("1") elif studentGrade Math == "D-": print("0.5")...
18:55 Mon 27th May 2019
if studentGradeMath == "A":
print("4")
elif studentGradeMath == "A-":
print("3.5")
elif studentGradeMath == "B":
print("3")
elif studentGradeMath == "B-":
print("2.5")
elif studentGradeMath == "C":
print("2")
elif studentGradeMath == "C-":
print("1.5")
elif studentGradeMath == "D":
print("1")
elif studentGradeMath == "D-":
print("0.5")
else:
print("0")
else statements don't have a conditional, and ensure the print statements are indented.
print("4")
elif studentGradeMath == "A-":
print("3.5")
elif studentGradeMath == "B":
print("3")
elif studentGradeMath == "B-":
print("2.5")
elif studentGradeMath == "C":
print("2")
elif studentGradeMath == "C-":
print("1.5")
elif studentGradeMath == "D":
print("1")
elif studentGradeMath == "D-":
print("0.5")
else:
print("0")
else statements don't have a conditional, and ensure the print statements are indented.
I fixed and finished it. thank you everyone. you can customize the calculator and other peices of it and add or remove as you see fit:
studentGradeMath = input("Enter student letter grade for Math - ").upper()
studentGradeWriting = input("Enter student letter grade for Writing - ").upper()
studentGradeReading = input("Enter student letter grade for Reading- ").upper()
studentGradeAttendance = input("Enter student letter grade for Attendance- ").upper()
studentGradeHistory = input("Enter student letter grade for History - ").upper()
if studentGradeMath == "A":
print("4")
elif studentGradeMath == "A-":
print("3.5")
elif studentGradeMath == "B":
print("3")
elif studentGradeMath == "B-":
print("2.5")
elif studentGradeMath == "C":
print("2")
elif studentGradeMath == "C-":
print("1.5")
elif studentGradeMath == "D":
print("1")
elif studentGradeMath == "D-":
print("0.5")
else:
print("0")
if studentGradeWriting == "A":
print("4")
elif studentGradeWriting == "A-":
print("3.5")
elif studentGradeWriting == "B":
print("3")
elif studentGradeWriting == "B-":
print("2.5")
elif studentGradeWriting == "C":
print("2")
elif studentGradeWriting == "C-":
print("1.5")
elif studentGradeWriting == "D":
print("1")
elif studentGradeWriting == "D-":
print("0.5")
else:
print("0")
if studentGradeHistory == "A":
print("4")
elif studentGradeHistory == "A-":
print("3.5")
elif studentGradeHistory== "B":
print("3")
elif studentGradeHistory == "B-":
print("2.5")
elif studentGradeHistory == "C":
print("2")
elif studentGradeHistory == "C-":
print("1.5")
elif studentGradeHistory == "D":
print("1")
elif studentGradeHistory == "D-":
print("0.5")
else:
print("0")
if studentGradeAttendance == "A":
print("4")
elif studentGradeAttendance == "A-":
print("3.5")
elif studentGradeAttendance == "B":
print("3")
elif studentGradeAttendance == "B-":
print("2.5")
elif studentGradeAttendance == "C":
print("2")
elif studentGradeAttendance == "C-":
print("1.5")
elif studentGradeAttendance == "D":
print("1")
elif studentGradeAttendance == "D-":
print("0.5")
else:
print("0")
if studentGradeReading == "A":
print("4")
elif studentGradeReading == "A-":
print("3.5")
elif studentGradeReading == "B":
print("3")
elif studentGradeReading == "B-":
print("2.5")
elif studentGradeReading == "C":
print("2")
elif studentGradeReading == "C-":
print("1.5")
elif studentGradeReading == "D":
print("1")
elif studentGradeReading == "D-":
print("0.5")
else:
print("0")
def add(x, y, g, f, t):
return x + y + g + f + t
print("Select operation.")
print("1.Add")
choice = input("Enter choice(1):")
num1 = int(input("Enter first number: "))
num2 = int(input("Enter next number: "))
num3 = int(input("Enter next number: "))
num4 = int(input("Enter next number: "))
num5 = int(input("Enter next number: "))
if choice == '1':
print(num1,"+",num2, "+",num3,"+",num4, "+",num5,"=", add(num1,num2,num3,num4,num5))
else:
print("Invalid input")
studentGradeMath = input("Enter student letter grade for Math - ").upper()
studentGradeWriting = input("Enter student letter grade for Writing - ").upper()
studentGradeReading = input("Enter student letter grade for Reading- ").upper()
studentGradeAttendance = input("Enter student letter grade for Attendance- ").upper()
studentGradeHistory = input("Enter student letter grade for History - ").upper()
if studentGradeMath == "A":
print("4")
elif studentGradeMath == "A-":
print("3.5")
elif studentGradeMath == "B":
print("3")
elif studentGradeMath == "B-":
print("2.5")
elif studentGradeMath == "C":
print("2")
elif studentGradeMath == "C-":
print("1.5")
elif studentGradeMath == "D":
print("1")
elif studentGradeMath == "D-":
print("0.5")
else:
print("0")
if studentGradeWriting == "A":
print("4")
elif studentGradeWriting == "A-":
print("3.5")
elif studentGradeWriting == "B":
print("3")
elif studentGradeWriting == "B-":
print("2.5")
elif studentGradeWriting == "C":
print("2")
elif studentGradeWriting == "C-":
print("1.5")
elif studentGradeWriting == "D":
print("1")
elif studentGradeWriting == "D-":
print("0.5")
else:
print("0")
if studentGradeHistory == "A":
print("4")
elif studentGradeHistory == "A-":
print("3.5")
elif studentGradeHistory== "B":
print("3")
elif studentGradeHistory == "B-":
print("2.5")
elif studentGradeHistory == "C":
print("2")
elif studentGradeHistory == "C-":
print("1.5")
elif studentGradeHistory == "D":
print("1")
elif studentGradeHistory == "D-":
print("0.5")
else:
print("0")
if studentGradeAttendance == "A":
print("4")
elif studentGradeAttendance == "A-":
print("3.5")
elif studentGradeAttendance == "B":
print("3")
elif studentGradeAttendance == "B-":
print("2.5")
elif studentGradeAttendance == "C":
print("2")
elif studentGradeAttendance == "C-":
print("1.5")
elif studentGradeAttendance == "D":
print("1")
elif studentGradeAttendance == "D-":
print("0.5")
else:
print("0")
if studentGradeReading == "A":
print("4")
elif studentGradeReading == "A-":
print("3.5")
elif studentGradeReading == "B":
print("3")
elif studentGradeReading == "B-":
print("2.5")
elif studentGradeReading == "C":
print("2")
elif studentGradeReading == "C-":
print("1.5")
elif studentGradeReading == "D":
print("1")
elif studentGradeReading == "D-":
print("0.5")
else:
print("0")
def add(x, y, g, f, t):
return x + y + g + f + t
print("Select operation.")
print("1.Add")
choice = input("Enter choice(1):")
num1 = int(input("Enter first number: "))
num2 = int(input("Enter next number: "))
num3 = int(input("Enter next number: "))
num4 = int(input("Enter next number: "))
num5 = int(input("Enter next number: "))
if choice == '1':
print(num1,"+",num2, "+",num3,"+",num4, "+",num5,"=", add(num1,num2,num3,num4,num5))
else:
print("Invalid input")