Create a program in Python to accept input from a student and then display if the student is eligible to graduate and if so if they will graduate cum laude, magna cum laude or summa cum laude.
Your program should prompt the student to enter his/her name and gpa. If the gpa is 4.0, then display a message stating that he/she has graduated summa cum laude. If the gpa is less than 4.0 but greater than or equal to 3.8, then display a message that they have graduated magna cum laude. If the gpa is not greater than or equal to 3.8 but greater than or equal to 3.5, then display a message that they have graduated cum laude. If the gpa is less than 3.5 but greater than 2.0, display a message that they have graduated. If the gpa is less than 2.0, display a message that they are not eligible to graduate but can take more courses to bring their gpa up to at least 2.0.
#corecudr
name = input('Enter your name: ')
gpa = float(input('Enter your gpa: '))
if gpa == 4.0: print("Summa cum laude")
elif gpa < 4.0 and gpa >= 3.8: print("Magna cum laude")
elif gpa >= 3.5 and gpa < 3.8: print("Cum laude")
elif gpa >= 2.0 and gpa < 3.5: print("Your are graduated")
elif gpa < 2.0: print("You are not graduated, but you can take courses to raise your gpa")
Example:
Enter your name: Azimjon
Enter your gpa: 3.4
Your are graduated
Comments
Leave a comment