Skip to content

Statistics Calculator

The following table contains a description of a small statistics programs. This program reads a number of values from the user, and then outputs some statistics calculated from these values. This program will make use of arrays to store the values entered, and then calculate the required statistics.

NameStatistics Calculator
DescriptionReads values from the user and calculates a range of statistics that are output to the Terminal. Statistics output include mean, maximum, and sum.
Description of the statistics calculator program

As before, the process to design and implement this program will follow a number of steps:

  1. Understand the problem, and get some ideas on the tasks that need to be performed.
  2. Choose the building blocks we will create and use
  3. Design the control flow for the functions and procedures we need
  4. Implement our design
  5. Compile, run, and test the program

It is important to code as you go, so we will be implementing the design as we go through the steps.

Understanding Statistics Calculator

Most of the ideas around the statistics calculator should be fairly straight forward. The main things to be checked are the equations needed to calculate the different statistics, and then to convert these into steps for the computer. This should allow us to focus on arrays, and how we can use them to store the values entered by the user.