Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Monolithic program
- def main():
- print("Welcome to the Student Grade Calculator!")
- while True:
- student_name = input("Enter student name (or type 'exit' to quit): ")
- if student_name.lower() == 'exit':
- print("Goodbye!")
- break
- student_score = input("Enter student score: ")
- student_score = int(student_score)
- if 90 <= student_score <= 100:
- student_grade = "A"
- elif 80 <= student_score < 90:
- student_grade = "B"
- elif 70 <= student_score < 80:
- student_grade = "C"
- elif 60 <= student_score < 70:
- student_grade = "D"
- else:
- student_grade = "F"
- print(f"Student {student_name} scored {student_score} and received a grade of {student_grade}.")
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement