Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print "GRADE CALCULATOR PROGRAM\n"
- username = raw_input("Enter your first and last name: ").title()
- address = raw_input("Enter you street addresss: ").title()
- city = raw_input("Enter your city: ").title()
- state = raw_input("Enter your state abbreviation: ").upper()
- zipcode = raw_input("Enter your zipcode: ")
- courseloop = 0
- coursename = raw_input("\nEnter course name (Type 'STOP' when finished: ").upper()
- while coursename != "STOP" and courseloop < 5:
- courseloop += 1
- assignmentscore = float(raw_input("\tEnter points recieved for this assignment (Type '9999' when finished): "))
- assignmentscore += totalpoints
- while assignmentscore != 9999:
- pointspossible = float(raw_input("\tEnter points possible for this assignment: "))
- pointspossible += coursepoints
- assignmentscore = float(raw_input("\tEnter points recieved for this assignment (Type '9999' when finished): "))
- if assignmentscore != 9999:
- coursepoints += assignmentscore
- if courseloop == 1:
- course1 = coursename
- coursegrade1 = ((totalpoints / coursepoints)*100)
- elif courseloop == 2:
- course2 = coursename
- coursegrade2 = ((totalpoints / coursepoints)*100)
- elif courseloop == 3:
- course3 = coursename
- coursegrade3 = ((totalpoints / coursepoints)*100)
- elif courseloop == 4:
- course4 = coursename
- coursegrade4 = ((totalpoints / coursepoints)*100)
- elif courseloop == 5:
- course5 = coursename
- coursegrade5 = ((totalpoints / coursepoints)*100)
- if courseloop < 5:
- coursename = raw_input("\nEnter course name (Type 'STOP' when finished): ").upper()
- gpa = ((coursegrade1 + coursegrade2 + coursegrade3 + coursegrade4 + coursegrade5) / courseloop)
- "\n"
- print username
- print address
- print city+",", state, zipcode
- if course1 != "":
- print course1 + " percentage grade",round(coursegrade1,2), "%"
- if course2 != "":
- print course2 + " percentage grade", round(coursegrade2,2), "%"
- if course3 != "":
- print course3 + " percentage grade", round(coursegrade3,2), "%"
- if course4 != "":
- print course4 + " percentage grade", round(coursegrade4,2), "%"
- if course5 != "":
- print course5 + " percentage grade", round(coursegrade5,2), "%"
- raw_input("\nRun complete. Press the Enter key to exit.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement