Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The purpose of this assignment is to reinforce concepts around looping, data validation, and control structures, to provide practice with signed arithmetic operations, and to

The purpose of this assignment is to reinforce concepts around looping, data validation, and control structures, to provide practice with signed arithmetic operations, and to bring the status register flags into focus (CLO 3, 4).

Implementing data validation

Implementing an accumulator

Integer arithmetic

Defining variables (integer and string)

Using constants (integer)

Using library procedures for I/O

Implementing control structures (decision, loop)

What you must do

Program Description

Write and test a MASM program to perform the following tasks:

Display the program title and programmers name.

Get the user's name, and greet the user.

Display instructions for the user.

Repeatedly prompt the user to enter a number.

Validate the user input to be in [-200, -100] or [-50, -1] (inclusive).

Notify the user of any invalid negative numbers (negative, but not in the ranges specified)

Count and accumulate the valid user numbers until a non-negative number is entered. Detect this using the SIGN flag. (The non-negative number and any numbers not in the specified ranges are discarded.)

Calculate the (rounded integer) average of the valid numbers and store in a variable.

Display:

the count of validated numbers entered NOTE: if no valid numbers were entered, display a special message and skip to (f)

the sum of valid numbers

the maximum (closest to 0) valid user value entered

the minimum (farthest from 0) valid user value entered

the average, rounded to the nearest integer

-20.01 rounds to -20

-20.5 rounds to -20

-20.51 rounds to -21

-20.99 rounds to -21

a parting message (with the users name)

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 Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

Choosing Your Topic Researching the Topic

Answered: 1 week ago

Question

The Power of Public Speaking Clarifying the

Answered: 1 week ago