Question
Question 4: Write a 64-bit x86-64 assembly language program that given a collection of N numbers will find the largest value, the frequency of the
Question 4: Write a 64-bit x86-64 assembly language program that given a collection of N numbers will find the largest value, the frequency of the largest value (i.e., the number of times the largest value appears in the collection), and the average of the N numbers.
Get the value of N from the user.
If N
Read the values as entered from the user. (If N =5, then there are 5 values the user is going to enter).
Find the Largest, the frequency of the largest value, and the average of these N values.
Hint: To find the largest value, read the first value before the loop then assume that this first value entered by the user is the largest value and its frequency is 1. Within the loop compare the assumed largest value with other values read inside the loop and change the largest value and frequency accordingly.
Note: Your solution must not use arrays and data files.
Sample program run:
Enter how many values to consider: 6 Enter value 1: 12.5 Enter value 2: 50.0 Enter value 3: 3.0 Enter value 4: 50.0 Enter value 5: 45.0 Enter value 6: 50.0 Largest value -50.00 The frequency of the largest value3 Average35.08
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started