What the final value of the variable sum e was

Assignment Help C/C++ Programming
Reference no: EM131015267

part 1: Implement the following C++ code fragment in assembly language. Use the block-structured .IF and.WHILE directives. Assume that all variables are 32-bit integers.

int array[] = {3,1,4,1,5,9,2,6, 5,3,5,8,9,7,9,3,2,3,8,4};
int lower = 3;
int upper = 8;
int ArraySize = sizeof array / sizeof lower;
int index = 0;
int sum = 0;
while( index < ArraySize )
{
if( array[index] >= lower && array[index] <= upper )
{
sum += array[index];
}
index++;
}

Your assembly language program must also display as output the number of times a member of ' array 'e qualified for inclusion into the 'sum 'e and what the final value of the variable ' sum 'e was.

Part 2: Write a program that asks the user to enter an integer dollar amount between 1 and 5,000. Your program should display the corresponding class description using the following table. Write the program so that it executes until the user inputs some value that you determine to be the "stop value". Your program must guard against and provide user messages for input values that are outside the valid range.

Donation Amount (dollars)

Class of Donation

$4,000 to $5,000

Platinum

$3,000 to $3,999

Gold

$2,000 to $2,999

Silver

$1,000 to $1,999

Bronze

$1 to $999

Copper

Reference no: EM131015267

Questions Cloud

Gain or loss did bogus recognize on the exchange : What gain or loss did Bogus recognize on the exchange, assuming no commercial substance 48,600 loss 24,000 gain 0 gain/loss none of the above
Compute the amount of goodwill acquired by winans : At the time of purchase, Aumont's balance sheet showed assets of $611,070, liabilities of $201,660, and owners' equity of $409,410. The fair value of Aumont's assets is estimated to be $819,560. Compute the amount of goodwill acquired by Winans.
What is the total amount of debt : forfeitures of benefits under the plan may be reallocated to the remaining participantsthe company must make contributions to the plan if it has profits during the year.
Description of the community you selected : description 2 Pagea description of the community you selected (New York, or Any American Urban City). Then, explain the strengths and challenges associated with that community based on its characteristics. Finally, explain how you, as a social wor..
What the final value of the variable sum e was : Write a program that asks the user to enter an integer dollar amount between 1 and 5,000. Your program should display the corresponding class description using the following table. Write the program so that it executes until the user inputs some v..
Types of natural and man-made disasters and attacks : What type of natural hazard do you think is the most significant or troublesome to emergency managers - what type of man-made hazard do you think is the most significant or troublesome to emergency managers? Why?
Was the study design cross-sectional or longitudinal : What were the units of analysis? Were they appropriate for the research question? Was the study design cross-sectional or longitudinal? Was a sample or the entire population of elements used in the study? What type of sample was selected
Activity rate for product design activity cost pool : What is the activity rate for the Product Design activity cost pool? Product design activity cost pool $ per product
Predominantly substantive approach : Which of the following audit strategies would be most appropriate when an auditor has assessed a predominantly substantive approach is necessary to determine inventory quantity?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Programing in c data validity

write a main function to input 20 integers in the range of 1 to 6. write a function count the number of times the numbers 2 and 5 occur. the function should declare static variables count2 and count5. check the data validity in the main functi..

  Evaluate the circumference of a circle

Write a program that will call a function to calculate the area of a circle, and call another function to calculate the circumference of a circle.

  Program that asks the user for two integers and a character

Write a program that asks the user for two integers and a character, 'A', 'S', or 'M'. Call one of three functions that adds, substracts, or multiplies the user's integers, based on the character input.

  Make program using switch statements in visual basic/c++

Enter the year code, course code, number of units and output the year name, course name, tuition fee and the balance tuition fee of the student.

  Preparing a high level language program

Describe the purpose of each step in preparing a high level language program for execution (editing, compiling, linking, and loading).  Include in your description the types of files created with each of the first three steps.?

  Write a program that declares an array of 10 integers

Write a program that declares an array of 10 integers. Write a loop that accepts 10 values from the keyboard, and write another loop that displays the 10 values. Do not use any subscripts within the two loops; use pointers only.

  When should an attribute of a class be static

Is there ever a reason to have a public attribute in a class?

  Write c function to perform complex addition and subtraction

Write C functions to perform complex addition, subtraction, multiplication, and division using the complex structure dis­ cussed in this chapter. Add these functions to the calculator program. You will have to allow the user to specify a complex v..

  Linked list with first node pointer p.

Complete the code for a function that replaces each occurrence of value x by value y in a linked list with first node pointer p.

  Rational class performs operations on fractions

Write a C++ program that, using the rational class performs operations on fractions. Test your class thoroughly.

  Write a c++ program that asks the user for a radius r

Write a c++ program that asks the user for a radius r. The program must include a function called calcwradius that accepts the value of the radius r, and calls the function pi shown below.

  Translate than c source code

Why does Ada take so much more time to translate than C source code? What phase of the Ada translation takes the longest?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd