CSc 3210 Computer Organization and Programming
Fall 1999
Programming Assignment #3 (Due: 27 October 1999, Wednesday)

Assignment Objectives:

  1. To gain more experience with reading from keyboard, converting ascii into integers, and sorting of numbers.
  2. Improve you assembly programming skills.

Problem Description:

Write an assembler program that will clear the screen and repeatedly prompt the user to enter a score (number between 0 and 20). The prompt should be:


Please enter a score: 

somewhere in the middle of the screen at the same place each time. If any of the input numbers is not a valid number, the program should display a message at the bottom of the screen and ignore the input. Make sure that the message is gone when the next valid number is entered or the input has terminated.

The program should store these numbers in an array. The user will terminate the input with only the ENTER key. You may assume that there will be no more than 50 numbers entered. When the user input is over, the program should sort the numbers in descending order, calculate the average score (rounded off to a whole number), and produce an output screen as follows:

    
  Grade A: 20, 19, 19, 16
  Grade B: 14, 14, 12, 12, 12, 11
  Grade C: 9, 9, 8, 8, 8, 8
  Grade D: 4, 4, 3, 3, 1

  Average: 10
The scores must be printed in descending order. All scores greater or equal to 15 is considered Grade A; between 10 and 14 Grade B; between 5 and 9 Grade C; and any score less than 5 Grade D. The program should then print the message:
Do you want to see a histogram?
at the bottom of the screen. If the user answers y, the program should clear the screen and display the histogram as follows:
20: *
19: **
18:
17:
16: *
15: 
14: **
13:
12: ***
11
10:
 9: **
 8: ****
 7:
 6:
 5:
 4: **
 3: ** 
 2: 
 1: *
 0:
The program should then wait for the user to enter a key before terminating. If the user enters n, the program should terminate.

Submission Instructions: score.asm and score.exe on a floppy disk by the deadline and submit a hard copy printout of the program listing of score.asm.



Raj Sunderraman
Oct 17, 1999