Create a python program that gets students lastname, firstname, and finalmark, then calculates the letter grade based on the following criteria;
A student with mark lower than 50 should receive a letter grade F, between 50 and 54 receives D, between 55 and 64 a C, 65 and 79 should receive a B and anything equal and above 80 should be an A.
Your program should utilize the following functions
a) getLastname(), returns student first name
b) getFirstname(), returns student first name
c) getMark(), returns student mark
d) computeGrade(), which accepts student mark and returns appropriate letter grade
e) student(), that gets relevant student data (lastname, first name, mark, and letter grade) and stores it as a single object (list)
f) classlist() that repeatedly asks if there are more students and stores multiple students data as single object, list
g) displayClasslist() that displays the classlist as shown by the following example;
Any more student in your class? (yes/no) yes
Student's Last name: Larson
Student's first name: Carson
Enter the student's mark: 90
Any more student in your class? (yes/no) yes
Student's Last name: Johnson
Student's first name: Bob
Enter the student's mark: 80
Any more student in your class? (yes/no) no
Computer's 101 Classlist
LastName FirstName Mark. Final Grade
------------------------------------------------------------------
Larson Carson 90 A
Johnson Bob 80 A
Your program should only accept valid names (only alphabets characters) and mark (between 0 and 100).
This is what I have so far:
A student with mark lower than 50 should receive a letter grade F, between 50 and 54 receives D, between 55 and 64 a C, 65 and 79 should receive a B and anything equal and above 80 should be an A.
Your program should utilize the following functions
a) getLastname(), returns student first name
b) getFirstname(), returns student first name
c) getMark(), returns student mark
d) computeGrade(), which accepts student mark and returns appropriate letter grade
e) student(), that gets relevant student data (lastname, first name, mark, and letter grade) and stores it as a single object (list)
f) classlist() that repeatedly asks if there are more students and stores multiple students data as single object, list
g) displayClasslist() that displays the classlist as shown by the following example;
Any more student in your class? (yes/no) yes
Student's Last name: Larson
Student's first name: Carson
Enter the student's mark: 90
Any more student in your class? (yes/no) yes
Student's Last name: Johnson
Student's first name: Bob
Enter the student's mark: 80
Any more student in your class? (yes/no) no
Computer's 101 Classlist
LastName FirstName Mark. Final Grade
------------------------------------------------------------------
Larson Carson 90 A
Johnson Bob 80 A
Your program should only accept valid names (only alphabets characters) and mark (between 0 and 100).
This is what I have so far:
def classlist(): more_students = input("Any more students in your class? (yes/no) ") def getLastname(): last_name = input("\nStudent's last name: ") print() return last_name def getFirstname(): first_name = input("Student's first name: ") print() return first_name def getMark(): student_mark = input("Enter the student's mark: ") print() return student_mark def computeGrade(): score = int(round(score)) if score >= 80: return "A" if score >= 65 and score <= 79: return "B" if score >= 55 and score <= 64: return "C" if score >= 50 and score <= 54: return "D" if score < 50: return "F" def program(): more_students = classlist() last_name = getLastname() first_name = getFirstname() student_mark = getMark() score = computeGrade() program()Kinda stuck at this point as to what I'm supposed to do next. Help?!