CIS 150 C++ Programming Project: Arrays

Objectives

  1. Follow instructions (program requirements)
  2. Declare and use a constant
  3. Create and use arrays
  4. Create and use functions
  5. Create prototypes for functions
  6. Create random numbers
  7. Use repetition
  8. Pass arrays to functions
  9. Format output

Overview

This assignment involves creating an array and three functions to process an array. The first function fills an array with random numbers. The second function calculates a sum for the elements of an array. The third function displays an array in a nice format.

Program requirements

Sample Runs

Sample run #1

  30  26  56  28   2  70  89  49   1  81
  24  56   1  61  94  44  68  50  46  45
  33  41  92  38  30  33  38  88  59  96
  30  43  23  39  33  60   9  62  61  46
The total is 1875
The average is 46.875

Sample run #2

  32  75  87  18  60  60   8  56  56  75
  89  53  25  30  47  75  37  14  16  88
  89  57  81   1  15  88  35  90  67  37
  42  54  69  43  95  46  88  42  46  42
The total is 2128
The average is 53.2

Sample run #3 (with the constant set to 13)

  14  82  77   6  41  12  39  15  23  19
  32  17  71   7
The total is 455
The average is 32.5

Rubric