Question
USE MASM LANGUAGE FOR THIS PROGRAM. Write a program to find the sum and the average of a set of numbers. You will generate the
USE MASM LANGUAGE FOR THIS PROGRAM.
Write a program to find the sum and the average of a set of numbers. You will generate the set of numbers and the numbers you generate has a pattern. Starting at 0, the next number in the patter is three greater than the last number, then the next number is eight greater then the last, then the last number is 5 greater then the last, then the pattern starts over, 3, 8, 5. Each next number in the patter increases by 3 then the next by 8 then the next by 5.
Ex generated: 0 3 11 16 19 22 30 35 .
So you are to write a program to generate the set of numbers using the repeating pattern described above. Generate the list of numbers stopping when the last value is greater than 400. You are then to calculate the sum and the average of the set of numbers. (I dont know how many numbers there are from 0 to 400, nor do you, but your program will count the number of value.
Output: Print out the array of numbers, 7 numbers per output line. (Do not print these numbers down the page, ie one number per line.) Then print out the number values in the list, the sum and the average. Label all output.
Restrictions: You are to use loops and procedures. Your program must generate the list of numbers (call a procedure). Print out the array of generated numbers (call a procedure to print array, again print 7 numbers per line). A procedure to compute sum and a procedure to compute average. You already have a procedure integer to ascii and a procedure to print out a line. Other words, implement this program using procedures.
Take a guess on how big the array for the sequence of numbers needs to be. (Also when printing the sequence you can print a CR and LF characters by themselves after 7 numbers??? Sounds like you can call a procedure call printCRLF ??????)
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