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.

  1. 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.

    Pseudo-code:
    main()
    declare *aList
    declare aMean
    call subInputList(&aList)
    let aMean = funCalculateMean(&aList)
    call subOutputList(&aList)
    call subOutputMean(aMean)
    end

Respond to this Question

First Name

Your Answer

Similar Questions

  1. 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.
  2. 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 …
  3. 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 …
  4. 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 …
  5. 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.
  6. 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.
  7. 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 …
  8. 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 …
  9. COP 2000-6

    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 …
  10. 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 sub-program to …

More Similar Questions