This program contains two procedures to calculate a student's grade. The first procedure calculates the total marks based on percentages from midterm, final project, quizzes and projects. The second procedure calculates the letter grade based on ranges of the total marks from A+ to F. User input for the marks is taken and overall grade is displayed.
1 of 3
More Related Content
Session 9 1 alp to compute a grade using procedures
1. Write a ALP program that will compute a grade for this class based on grades input into it. Write two
different procedures one for computing total marks based of different examinations held and another
for computing overall grade of student.
Procedures-I: The total marks will be computed as follows:
20% Midterm Exam
20% Final Project
30% Quizzes
30% Projects
Procedure-II: The letter grade will be computed from the overall grade as
follows:
93+: A
90+: A-
87+: B+
83+: B
80+: B-
77+: C+
73+: C
70+: C-
65+: D
0+: F
.model small
.data
mid db 10,13,'Midterm Exam Marks(0-20): $'
prj db 10,13,'Final Project Marks(0-20): $'
quz db 10,13,'Quizzes Marks(0-30): $'
pjs db 10,13,'Projects Marks(0-30): $'
grd db 10,13,'Grade :$'
.code
mov ax, @data
mov ds, ax
call totm
call grad
mov ah, 4ch
int 21h
proc totm
mov ah, 9
lea dx, mid
int 21h
call readno
cmp al, 20h
ja totm
mov ch,al
rdprj:
mov ah, 9
lea dx, prj
int 21h
call readno
cmp al, 20h
ja rdprj
add ch,al
rdqz: