QuestionQuestion

Test Score Evaluation
Create a procedure named CalcGrade that receives an integer value between 0 and 100, and returns a single capital letter in the AL register. Preserve all other register values between calls to the procedure. The letter returned by the procedure should be according to the following ranges:

Score Range & Letter Grade
90 to 100, A
80 to 89, B
70 to 79, C
60 to 6 9, D
0 to 59, F

Write a test program that generates 10 random integers between 50 and 100, inclusive. Each time an integer is generated, pass it to the CalcGrade procedure. You can test your program using a debugger, or if you prefer to use the book’s library, you can display each integer and its corresponding letter grade. (The Irvine32 library is required for this solution program because it uses the RandomRange procedure.)

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

INCLUDE Irvine32.inc
.data
str1 BYTE "Test score generated is: ", 0
str2 BYTE "The letter grade is: ", 0
.code

main PROC
call Clrscr
mov ecx,10

L1:
call GenerateScore ; generate random integer
loop L1
exit

main ENDP

GenerateScore PROC USES eax edx
mov eax,51
call RandomRange
add eax,50
mov edx, OFFSET str1
call WriteString
call WriteDec
call Crlf
call CalcGrade

mov edx, OFFSET str2
call WriteString
call WriteChar
call Crlf
call Crlf...

By purchasing this solution you'll be able to access the following files:
Solution.asm.

$5.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Assembly Language Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats