Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a 64-bit x86-64 assembly language program that given a collection of N numbers will find the smallest value, the frequency of the smallest value

Write a 64-bit x86-64 assembly language program that given a collection of N numbers will find the smallest value, the frequency of the smallest value (i.e., the number of times the smallest value appears in the collection), and the average of the negative numbers in the collection.(intel processors)

  1. Get the value of N from the user.
  2. If N
  3. Read the values as entered from the user. (If N =5, then there are 5 values the user is going to enter).
  4. Find the smallest, the frequency of the smallest value, and the average the negative numbers in the collection.

  1. image text in transcribed
Hint: To find the smallest value, read the first value before the loop then assume that this first value entered by the user is the smallest value and its frequency is 1. Within the loop compare the assumed smallest value with other values read inside the loop and change the smallest value and frequency accordingly. Note: Your solution must not use arrays and data files. Sample program runs: Enter the number of values to consider: Enter a value: 3 Enter a value: 5 Enter a value: 7 Enter a value: 3 Enter a value: 12 Enter a value: 4 The smallest valueis 3 The frequency of the smallest value is 2 No negative values entered Enter the number of values to consider: 5 Enter a value: -2 Enter a value: 6 Enter a value: 3 Enter a value:-3 Enter a value: 3 The smallest value is -3 The frequency of the smallest value is 3 The average of negative values is -2.75 Enter the number of values to consider: 8 Error Invalid input. Hint: To find the smallest value, read the first value before the loop then assume that this first value entered by the user is the smallest value and its frequency is 1. Within the loop compare the assumed smallest value with other values read inside the loop and change the smallest value and frequency accordingly. Note: Your solution must not use arrays and data files. Sample program runs: Enter the number of values to consider: Enter a value: 3 Enter a value: 5 Enter a value: 7 Enter a value: 3 Enter a value: 12 Enter a value: 4 The smallest valueis 3 The frequency of the smallest value is 2 No negative values entered Enter the number of values to consider: 5 Enter a value: -2 Enter a value: 6 Enter a value: 3 Enter a value:-3 Enter a value: 3 The smallest value is -3 The frequency of the smallest value is 3 The average of negative values is -2.75 Enter the number of values to consider: 8 Error Invalid input

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_2

Step: 3

blur-text-image_3

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

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

assess the infl uence of national culture on the workplace

Answered: 1 week ago