Computer Science 331

Principles of Programming Languages

Programming Assignment #1

"Above Average"

due Wednesday, January 16, by noon

 

This is a simple program to "warm you up" and to set up some basis for class discussion.  You are to write a C++ program at can take between 1 and 100 integers as data and then tells how many of the integers are "above average", i.e. how many of the data are greater than the mean.

Your program should begin by reading the number of integers from the user (prompts are neither necessary nor desired).  If this number is legal (i.e. is between 1 and 100 inclusive), then that many numbers should be read.  If it is not, then an error message should be printed.  A sample run is below.  User inputs are underlined.

4
1 2 3 4

The number of values > average is: 2

You are to write your program in C++.  You may use any standard class you wish.

You are to print out a listing of your program, along with two sample runs - one that produces output similar to the above (though a more substantial example would be nice) and one that shows your error message in action.    These are to be stapled together, along with a cover sheet, and are to be turned in to me by noon on January 16.