Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

**MASM Assembly Language x86: Need code (preferably with comments) for program described below. - Please read BOTH pages BEFORE answering. - Make sure ALL requirements

**MASM Assembly Language x86: Need code (preferably with comments) for program described below.

- Please read BOTH pages BEFORE answering.

- Make sure ALL requirements specified below are MET! Also include @ least 1 EC option.

**If ALL requirements are met, I WILL give positive reviews! Especially if EC options are included in your answer!!

image text in transcribed

image text in transcribed

Programming Assignment #4 Objectives: 1) Designing and implementing procedures 2) Designing and implementing loops 3) Writing nested loops 4) Understanding data validation Problem Definition: Write a program to calculate composite numbers. First, the user is instructed to enter the number of composites to be displayed, and is prompted to enter an integer in the range. 400]. The user enters a number, n, and the program verifies that 1 Sns 400. If n is out of range, the user is re- prompted until s/he enters a value in the specified range. The program then calculates and displays all of the composite numbers up to and including the nh composite. The results should be displayed 10 composites per line with at least 3 spaces between the numbers Requirements: 1) The programmer's name must appear in the output. 2) The counting loop (1 to n) must be implemented using the MASM loop instruction 3) The main procedure must consist (mostly) of procedure calls. It should be a readable "list" of what the program will do 4) Each procedure will implement a section of the program logic, i.e., each procedure will specify how the logic of its section is implemented. The program must be modularized into at least the following procedures and sub-procedures: ntroduction . getUserData validate showComposites isComposite farewell 5) The upper limit should be defined and used as a constant 6) Data validation is required. If the user enters a number outside the range[.400] an error message should be displayed and the user should be prompted to re-enter the number of composites. 7) The usual requirements regarding documentation, readability, user-friendliness, etc., apply. 8) Submit your text code file (asm) to Canvas by the due date Notes: 1) For this program, you may use global variables instead of passing parameters. This is a one- time relaxation of the standards so that you can get accustomed to using procedures A number k is composite if it can be factored into a product of smaller integers. Every integer greater than one is either prime or composite. Note that this implies that 2) a. 1 is not composite b. The number must be positive There are several ways to make your isComposite procedure efficient. (I recommend discussing this in your groups!) See next page for an example execution 3) 4) page 1 of 2 Programming Assignment #4 Objectives: 1) Designing and implementing procedures 2) Designing and implementing loops 3) Writing nested loops 4) Understanding data validation Problem Definition: Write a program to calculate composite numbers. First, the user is instructed to enter the number of composites to be displayed, and is prompted to enter an integer in the range. 400]. The user enters a number, n, and the program verifies that 1 Sns 400. If n is out of range, the user is re- prompted until s/he enters a value in the specified range. The program then calculates and displays all of the composite numbers up to and including the nh composite. The results should be displayed 10 composites per line with at least 3 spaces between the numbers Requirements: 1) The programmer's name must appear in the output. 2) The counting loop (1 to n) must be implemented using the MASM loop instruction 3) The main procedure must consist (mostly) of procedure calls. It should be a readable "list" of what the program will do 4) Each procedure will implement a section of the program logic, i.e., each procedure will specify how the logic of its section is implemented. The program must be modularized into at least the following procedures and sub-procedures: ntroduction . getUserData validate showComposites isComposite farewell 5) The upper limit should be defined and used as a constant 6) Data validation is required. If the user enters a number outside the range[.400] an error message should be displayed and the user should be prompted to re-enter the number of composites. 7) The usual requirements regarding documentation, readability, user-friendliness, etc., apply. 8) Submit your text code file (asm) to Canvas by the due date Notes: 1) For this program, you may use global variables instead of passing parameters. This is a one- time relaxation of the standards so that you can get accustomed to using procedures A number k is composite if it can be factored into a product of smaller integers. Every integer greater than one is either prime or composite. Note that this implies that 2) a. 1 is not composite b. The number must be positive There are several ways to make your isComposite procedure efficient. (I recommend discussing this in your groups!) See next page for an example execution 3) 4) page 1 of 2

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions

Question

Please make it fast 5 1 1 .

Answered: 1 week ago