Question
Write a MARIE program to calculate some basic statistics on a list of positive numbers. The program will ask users to input the numbers one
Write a MARIE program to calculate some basic statistics on a list of positive numbers. The program will ask users to input the numbers one by one. Assume that all numbers will be in the range 1 to 1000. To terminate the data entry, user will input any negative number. Once the data entry is complete, the program will show four statistics about the list of numbers: (1) Count (2) Minimum value (3) Sum of numbers (4) "Mean/Average" calculation.
As an example, if the user enters the following decimal numbers as input (one after the other)
23, 6, 78, 36, 3, 250, 127, 210, 5
the program would output the following values as the count, minimum, sum and mean respectively:
8 3 733 91
The average is calculated by dividing sum by count. Note that MARIE does not support floating point numbers, hence the result of division will only have the integer part (as shown in above example, average is 91 instead of 91.625)
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