Q5. Write a program to calculate the percentage of a student of five different subjects (Hindi, English, Science,
Math, Computer ) and print his/her division. The conditions to calculate division is-
Percentage>=60
A Grade
45<= Percentage< 60
B Grade
33<=Percentage<45
C Grade
Percentage<33
Fail
Answers
Answered by
2
Answer:
x = int(input("Enter max marks of each subject: "))
def grade (a, b, c, d, e):
x = a+b+c+d+e
y = x*5
if x/y*100 >= 60:
print('A grade')
elif x/y*100 <= 45 and x/y*100<60:
print("B grade")
elif x/y*100 <= 33 and x/y*100<45:
print("B grade")
else:
print("FAIL")
m = int(input("Enter marks in Hindi: "))
n = int(input("Enter marks in English: "))
o = int(input("Enter marks in Science: "))
p = int(input("Enter marks in Maths: "))
q = int(input("Enter marks in Computer: "))
#Call the function
grade(m, n, o, p, q)
This code works only in Python
Hope it works
Similar questions
Computer Science,
3 months ago
Accountancy,
7 months ago
Math,
7 months ago
Biology,
10 months ago
Math,
10 months ago