A student marking system receives input of student’s total mark from lecturer. If a studentgets total mark of 75 or above, the system will print ‘A’. If a student’s mark is between 65 to74, the system will print out ‘B’. While ‘C’ will be printed out if the mark is between 50 to 64.Whichever the total mark is below 50, ‘F’ will be printed
Question
A student marking system receives input of student’s total mark from lecturer. If a studentgets total mark of 75 or above, the system will print ‘A’. If a student’s mark is between 65 to74, the system will print out ‘B’. While ‘C’ will be printed out if the mark is between 50 to 64.Whichever the total mark is below 50, ‘F’ will be printed
Solution
This is a description of a simple grading system. Here's how you could implement it in Python:
def grade_system(mark):
if mark >= 75:
return 'A'
elif 65 <= mark < 75:
return 'B'
elif 50 <= mark < 65:
return 'C'
else:
return 'F'
# Test the function
print(grade_system(80)) # Output: A
print(grade_system(70)) # Output: B
print(grade_system(60)) # Output: C
print(grade_system(40)) # Output: F
In this code, the function grade_system takes a student's total mark as input and returns the corresponding grade. The if and elif statements check which range the mark falls into and return the appropriate grade. If the mark doesn't fall into any of the specified ranges (i.e., it's below 50), the function returns 'F'.
Similar Questions
A school has following rules for grading system: a. Below 25 - F b. 25 to 45 - E c. 45 to 50 - D d. 50 to 60 - C e. 60 to 80 - B f. Above 80 - A Ask user to enter marks and print the corresponding grade.
Problem StatementA computer science teacher assigned the students a programming task that calculates and displays grades based on test marks. The teacher wants the program to take a student's test mark as input and determine their grade using the following criteria:If the mark is between 90 and 100 (inclusive), assign grade A.If the mark is between 80 and 89 (inclusive), assign grade B.If the mark is between 70 and 79 (inclusive), assign grade C.If the mark is between 60 and 69 (inclusive), assign grade D.If the mark is between 45 and 59 (inclusive), assign grade E.For marks below 45 assign grade F.If the mark is greater than 100 or a negative number, it displays "Invalid input". Help the students to accomplish the given task.Note: This question helps in clearing AMCAT exam.Input format :The input consists of a single integer, representing the student's mark.Output format :The output displays "Grade: " followed by the grade for the given mark based on the given criteria.If the mark is greater than 100 or a negative number, the output displays "Invalid input".Refer to the sample output for the formatting specifications.Code constraints :In the given scenario, the test cases fall under the following constraints:0 ≤ student's mark ≤ 100Sample test cases :Input 1 :100Output 1 :Grade: AInput 2 :85Output 2 :Grade: BInput 3 :79Output 3 :Grade: CInput 4 :63Output 4 :Grade: DInput 5 :56Output 5 :Grade: EInput 6 :0Output 6 :Grade: FInput 7 :-5Output 7 :Invalid inputInput 8 :126Output 8 :Invalid input
Java Program To Accept the Marks of a Student and Find the Total Marks and Percentage
Write a C program using structure student which allows users to input details for three students including their names, roll numbers, and marks in 5 subjects. Use a function calculateTotalMarks(struct Student) which calculates the total marks and percentage for each student and displays the information. Each subject test is for 10 marks. Total marks = 50. Percentage = (marks obtained/total marks)*100.
Akulya has received her semester results. The performance in the exam is graded with letters S, A, B, C, D, E, and F. Help her to understand the mark range for a grade with respect to the mark obtained in the exam . Input FormatRead the course nameRead the markOutput FormatPrint the course namePrint the markPrint the GradeSample InputICSE102L89Sample OutputICSE102L89A GradeInput
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.