Computer Science
posted by Sandy
I need help with this problem. I don't know how to set it up correctly.
Input a list of positive numbers (terminated by 0)into an array, and output the result. Use a subprogram to output the numbers, a function to find the mean, an a subprogram to output the result. I know you have to have a main module, subprogram module, a function module, and a subprogram output module, but I don't know what should be put in any of them and the order they should be put in. Any help would be appreciated.

Graham
The main should declare and load the list structure (or object), and also a variable to hold the result.
The list structure cannot be fixed length; it needs to grow arbitrarily long.
You'll also need a way to input numbers into the list. Given your modular design, this should also be a subprogram.
The main should then send this list to the function module and retrieve the result.
The list should be sent to a second subprogram for output.
The result should be sent to a third subprogram for output.
Pseudocode:
main()
declare *aList
declare aMean
call subInputList(&aList)
let aMean = funCalculateMean(&aList)
call subOutputList(&aList)
call subOutputMean(aMean)
end
Respond to this Question
Similar Questions

Programming
Input a list of positive numbers (terminated by 0) into array, find the largest number in the array, and output the result. Use a subprogram to input the numbers, a function to find the largest, and a subprogram to output the result. 
computer science
Input a list of positive numbers (terminated by 0) into an array, find the mean (average) of the numbers in the array, and output the result. Use a subprogram to input the numbers, a function to find the mean, and a subprogram to output … 
Programming
Input a list of positive numbers (terminated by 0) into an array, find the mean (average) of the numbers in the array, and output the result. Use a subprogram to input the numbers, a function to find the mean, and a subprogram to output … 
Math
Input a list of positive numbers (terminated by 0) into an array find the mean (average) of the numbers in the array and output the results. Use a subprogram to input the numbers, a function to find the mean and a subprogram to output … 
programming
input a list of positive numbers terminated by 0 into a array. find the mean of the numbers in the array and output the result. use a subprogram to input numbers a function to find the mean and a subprogram to output the result. 
programming Please respond
input a list of positive numbers terminated by 0 into a array. find the mean of the numbers in the array and output the result. use a subprogram to input numbers a function to find the mean and a subprogram to output the result. 
computer programming
Input a list of positive numbers (terminated by 0) into an array, find the mean (average) of the numbers in the array, and output the result. Use a subprogram to input the numbers, a function to find the mean, and a subprogram to output … 
programming
Input a list of positive numbers (terminated by 0) into an array, find the mean (average) of the numbers in the array, and output the results. Use a subprogram to input the numbers, a function to find the mean, and a subprogram to … 
COP 20006
show an example of an user inputs a list of positive numbers terminated by 0 into an array, find the mean of the numbers in the array, and outputs th result. use a subprogram to input the numbers, a function to find the mean, and a … 
programming concepts
Input a list of positive numbers ( terminated by 0) into an array, find the mean ( average) of the numbers in the array, and output the result. Use a subprogram to input the numbers, a function to find the mean, and a subprogram to …