Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 4 [ 5 0 ] Design a program in assembly language to read a number entered by the user. The program should determine whether

Question 4[50]
Design a program in assembly language to read a number entered by the user. The program should determine whether or not the number is divisible by 3 and display an appropriate message based on the results on the screen. The program should do the following:
Clear the screen and change the screen colour to white on blue.
Change the cursor position to row 10, column 0. Prompt the user to key in the number (1-9). Read the number from the keyboard.
Convert the number to a numeric value and store in memory. Test whether the number is in the range 09. Display ** next to the number if the number is out of range and read again.
Divide the number by 3. If the remainder is equal to zero, we know that the number is divisible by 3, otherwise it is not.
If the number is divisible by 3, display the following message: Number is a multiple of 3 otherwise display the message Number is not a multiple of 3.
Terminate the program.
The following is an example of what the program should do. The user input is displayed in italics, i.e.9 below.
Please enter the number you select: 8
The number is not a multiple of 3
NB: Submit three screen shots of different test runs performed.
Marks will be allocated as follows:
Clearing the screen and changing the screen colour (3)
Changing the cursor position (2)
Displaying the user prompt (2)
Reading the number (ASCII character)(2)
Converting the number to a numeric value (2)
Testing the range and displaying an error message if the number is invalid (4)
Calculation (4)
A program listing submitted (6)
Three screen shots of test cases submitted (3\times 5)(15)
The program structure (5)
The program documentation (comments)(5)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

More Books

Students also viewed these Databases questions

Question

How did you feel about taking piano lessons as a child? (general)

Answered: 1 week ago