1. UTAMU University has tasked you to automate a simple grading system. As a python student, write a program using functions and conditions to display the grades that the students will be receiving. The grades are:90% - 100% Grade is A 80% - 89% Grade is B70% - 79% Grade is C 60% - 69% Grade is D 50% - 59% Grade is E <50% Fail
Question
1. UTAMU University has tasked you to automate a simple grading system. As a python student, write a program using functions and conditions to display the grades that the students will be receiving. The grades are:90% - 100% Grade is A 80% - 89% Grade is B70% - 79% Grade is C 60% - 69% Grade is D 50% - 59% Grade is E <50% Fail
Solution
Sure, here is a simple Python program that uses functions and conditions to display the grades:
def grade_system(score):
if score >= 90 and score <= 100:
grade = 'A'
elif score >= 80 and score < 90:
grade = 'B'
elif score >= 70 and score < 80:
grade = 'C'
elif score >= 60 and score < 70:
grade = 'D'
elif score >= 50 and score < 60:
grade = 'E'
else:
grade = 'Fail'
return grade
# Test the function
print(grade_system(85)) # Output: B
print(grade_system(95)) # Output: A
print(grade_system(75)) # Output: C
print(grade_system(65)) # Output: D
print(grade_system(55)) # Output: E
print(grade_system(45)) # Output: Fail
In this program, the function grade_system takes a score as input and returns the corresponding grade. The if and elif statements are used to check which range the score falls into, and the corresponding grade is assigned. The print statements at the end are used to test the function with different scores.
Similar Questions
As a python student, write a program using functions and conditions to display the grades that the students will be receiving. The grades are:90% - 100% Grade is A 80% - 89% Grade is B70% - 79% Grade is C 60% - 69% Grade is D 50% - 59% Grade is E <50% Fail
You have a class consisting of 5 students, each with a unique name and their respective marks. As the end of the semester approaches, you decide to assess the performance of your students and recognize their academic achievements.You write a Python program to categorize the students into different grades based on their marks. The program utilizes a Grade_analyzer class to represent each student and a StudentGradeAnalyzer function to analyze their grades. The function iterates through the list of students, calculates their grades and returns a dictionary containing the count of students in each grade.For grading:Students scoring between 80-100 will be in Grade A.Students scoring between 70-80 will be in Grade B.Students scoring between 60-70 will be in Grade C.Students scoring between 50-60 will be in Grade D.Students scoring below 50 will be in Grade E.Constraints:Input Format:5 lines of input, each line containing name and marks of each student.Ouptut Format:Should display items in dictionary which is holding Grades as keys and count of students falling under the grades as values.Example:Input:john 78missy 89sheldon 90mary 45meemaw 67Output:('A', 2)('B', 1)('C', 1)('D', 0)('E', 1)Explanation:input:--------Space saperated input name and marks for all the 5 students.john 78-->78 Falls into a range 70-80 so count of grade 'B' should be increased to 1.missy 89-->89 Falls into a range 80-100 so count of grade 'A' should be increased to 1.sheldon 90-->90 Falls into a range 80-100 so count of grade 'A' should be increased to 2.mary 45-->45 is less than 50 so count of grade 'E' should be increased to 1.meemaw 67-->67 Falls into a range 60-70 so count of grade 'C' should be increased to 1.
.Write a Python program to store marks scored in subject “Fundamental of DataStructure” by N students in the class and perform different operations.
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 GradeInputOutputProcessing InvolvedSolution AlternativesAlgorithm/ Pseudocode
Write a Java program that determines a student’s grade. The program will read three types ofscores(quiz, mid-term, and final scores) and determine the grade based on the following rules: -if theaverage score >=90% =>grade=A -if the average score >= 70% and <90% => grade=B -if theaverage score>=50% and <70% =>grade=C -if the average score<50% =>grade=F
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.