subject

The four smallest numbers (40 points) Write an ANNA assembly program (smallest_four. ac) that finds the four smallest numbers entered by the user. Initially, the program continually asks the user to enter numbers. As soon as a negative value is entered, compute which numbers are the top four (smallest) numbers. For instance, if the user entered 2, 6, 7, 6, 5, 7, 6, 17, 15 -1; the program should print 2, 5, 6, 6 (the four smallest numbers in the sequence). If the user enters a negative number at the beginning, print 0. If the user enters four or fewer numbers, print all the numbers as output. Notes:
• The goal of this problem is to exercise storing, retrieving, and scanning the numbers stored in memory. Therefore, a solution where you keep track of the smallest four numbers in registers as the numbers are entered is not acceptable. Such a solution will receive a maximum of 15 points for this problem.
• Do not keep track of everything in the input loop. You will need to store all numbers entered by the user in memory.
• Store all numbers entered into a growing array. • Note that The array should be the last item in your data section so it can grow as large as necessary.
• You may assume there is enough memory to hold all numbers entered by the user.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 03:00
Data is processed, stored, and transmitted as a series of 1s and 0s. each 1 or 0 is called a(n) . a series of eight 0s and 1s, called a(n) , represents one character—a letter, number, or punctuation mark. data becomes when it is presented in a format that people can understand and use. digital signals are represented by two different , such as +5 volts and +.2 volts. digital data can also take the form of light and dark spots etched onto the surface of a cd or the positive and negative orientation of particles on the surface of a hard disk. data consists of numbers that might be used in arithmetic operations. it can be represented digitally using the number system. data is composed of letters, symbols, and numerals that are not used in arithmetic operations. computers represent this type of data using , ebcdic, unicode, or utf-8. data is quantified using terms such as or kibibyte (1024 bytes), and prefixes such as or mebi (1,048,576), and giga or (1,073,741,824). to reduce file size and transmission times, digital data can be compressed. compression provides the means to compress data and reconstitute it into its original state. compression throws away some of the original data during the compression process. compressed files usually have at the end of the file name and are represented with special icons. these files have to be or unzipped before you can view the data they contain.
Answers: 1
question
Computers and Technology, 22.06.2019 05:30
Agood flowchart alludes to both the inputs and outputs you will need to receive and give to the user. true or false?
Answers: 3
question
Computers and Technology, 23.06.2019 11:30
The most accurate readings that you can take on an analog vom are when the meter's pointer is at the a. center scale. b. extreme right. c. near right. d. extreme left.
Answers: 1
question
Computers and Technology, 23.06.2019 15:00
Visually impaired individuals generally rely on the for navigation. thus, designers need to ensure that mouse-specific inputs, such as pointing, clicking, and hovering, can be done without a mouse.
Answers: 1
You know the right answer?
The four smallest numbers (40 points) Write an ANNA assembly program (smallest_four. ac) that finds...
Questions
question
Mathematics, 20.09.2020 01:01
question
Mathematics, 20.09.2020 01:01
Questions on the website: 13722363