- Joined
- Mar 14, 2006
- Location
- Earth
ASSIGNMENT
Design a defining diagram and algorithm that will
prompt an operator for a student’s serial number and the student’s exam score out of 100. Your program is then to match the exam score to a letter grade and print the grade to the screen. Calculate the letter grade as follows:
Exam score Assigned grade
90 and above A
80–89 B
70–79 C
60–69 D
below 60 F
HERES WHAT I HAVE
10 CLS
20 INPUT "type out student's serial number"; serial#
30 INPUT "what was percentage on your test"; test#
40 IF test# >= 90 THEN PRINT "you got an A"
50 IF test# >= 80 THEN PRINT "you got a B"
60 IF test# >= 70 THEN PRINT "you got a C"
70 IF test# >= 60 THEN PRINT "you got a D"
80 IF test# >= 50 THEN PRINT "you got a F"
90 END
My question is if i put the grade as 100, it says "you got an A, you got a B, you got a C, you got a D, you got an F. How do fix this? I want it to work as if i were to type the grade as a 93 i only want it to say you got an A.
Thanks
Design a defining diagram and algorithm that will
prompt an operator for a student’s serial number and the student’s exam score out of 100. Your program is then to match the exam score to a letter grade and print the grade to the screen. Calculate the letter grade as follows:
Exam score Assigned grade
90 and above A
80–89 B
70–79 C
60–69 D
below 60 F
HERES WHAT I HAVE
10 CLS
20 INPUT "type out student's serial number"; serial#
30 INPUT "what was percentage on your test"; test#
40 IF test# >= 90 THEN PRINT "you got an A"
50 IF test# >= 80 THEN PRINT "you got a B"
60 IF test# >= 70 THEN PRINT "you got a C"
70 IF test# >= 60 THEN PRINT "you got a D"
80 IF test# >= 50 THEN PRINT "you got a F"
90 END
My question is if i put the grade as 100, it says "you got an A, you got a B, you got a C, you got a D, you got an F. How do fix this? I want it to work as if i were to type the grade as a 93 i only want it to say you got an A.
Thanks