Você está na página 1de 1

Assignment 2:

Instruction: This is an individual assignment. It contributes to 10% of your marks. You must do
all the problems below and submit your program on next meeting.
Generate a grade based on a given mark
Write a program that will determine grade based on a mark entered by user.Marks are
integer values only. Grade are as follows
Marks
80 - 100
70 - 79
60 - 69
50 59
44 49
0 45

Grade
A
B
C
D
E
F

Your program will ask a user to enter the mark, and based on the mark entered, your
program will show the equivalent grade. The program will repeat and only quit if the user
wants to quit. If the grade entered higher than 100, display a red coloured message You
must be joking and if the user enter a value lower than 0, display a red coloured message
I know you can do better than that.
Your program must use the following procedure
DetermineGrade
PROC
; Receive: an integer value in register AL
; Return: grade as an ASCII value in register AL
;
;
ret
DetermineGrade ENDP

Please enter your mark: 59


Your grade is: D
Would you like to continue? Y
Please enter your mark: 109
You must be joking Please reenter your mark: -19
I know you can do better than that Please reenter your mark: 0
Your grade is: F
Would you like to continue? N

I hear and I forget. I see and I remember. I do and I understand.


"He that would perfect his work must first sharpen his tools."

Você também pode gostar