169k views
5 votes
Write an assembly program that will return a letter grade given a decimal int from the user. include the following: a user menu a main label, a looping label, and an exit label a way for the user to continue getting letter grades or choose to exit invalid input handling (do not just print an error message and exit the program; re-prompt the user until a correct input is entered)

User MarcM
by
8.0k points

1 Answer

1 vote

Final answer:

To write an assembly program for grading, you would need to handle user input, implement a grading scale, loop for re-attempts, and allow exit. The program would repeatedly ask for a score, convert it to a grade based on a defined scale, and then offer the option to continue or exit.

Step-by-step explanation:

Assembly Program for Letter Grades

Creating an assembly program to return a letter grade given a decimal integer requires handling user input, implementing a grading scale, and providing a loop for continued use or exiting the program. The pseudo code for such a program might involve a main label for program start, a looping label for re-prompts, and an exit label for program termination. The user menu would present options for obtaining a grade or exiting. Input validation is crucial to ensure the user enters a proper decimal number, and upon invalid input, the user would be re-prompted rather than the program exiting.

To illustrate, consider an example where the user enters a score, the program evaluates this score against a set grading scale, such as:

90-100: A

80-89: B

70-79: C

60-69: D

< 60: F

Depending on the score, the corresponding letter grade is returned. The user is then asked if they wish to enter another score or exit. On choosing to continue, the program loops back; otherwise, it reaches the exit label to end the execution.

User Sevil
by
8.2k points