1. Write a program that asks student's name and marks of any five subjects and calculates the total marks, percentage and grade on the basis of given criteria:
Percentage Grade
>=80 A
>=60 and <80 B
>45 and <60 C
>=32 and <45 D
<32 E
CLS
INPUT "Enter your name";N$
INPUT "Enter marks in five subjects";A,B,C,D,E
T=A+B+C+D+E
P=T/5
IF P>=80 THEN
PRINT "You have scored Grade A"
ELSEIF P>=60 AND P<80 THEN
PRINT "You have scored Grade B"
ELSEIF P>=45 AND P<60 THEN
PRINT "You have scored Grade C"
ELSEIF P>=32 AND P<45 THEN
PRINT "You have scored Grade D"
ELSE
PRINT "You have scored Grade E"
END IF
END
Percentage Grade
>=80 A
>=60 and <80 B
>45 and <60 C
>=32 and <45 D
<32 E
CLS
INPUT "Enter your name";N$
INPUT "Enter marks in five subjects";A,B,C,D,E
T=A+B+C+D+E
P=T/5
IF P>=80 THEN
PRINT "You have scored Grade A"
ELSEIF P>=60 AND P<80 THEN
PRINT "You have scored Grade B"
ELSEIF P>=45 AND P<60 THEN
PRINT "You have scored Grade C"
ELSEIF P>=32 AND P<45 THEN
PRINT "You have scored Grade D"
ELSE
PRINT "You have scored Grade E"
END IF
END
Comments
Post a Comment