Cmpsc 101, Project : if-elsif-else statement

Write a program which reads from the keyboard a positive integer number , call it n , which indicates to the program the number of values to follow. Each of the values which follow may be either negative, zero, or positive. Your program is supposed to do the following :

  1. Add up all the positive values and tell the user how many were given and what their average is.
  2. Add up all the negative numbers and tell the user how many were given and what their average is.
  3. Tell the user the numbers of zeroes among the entered values.

Sample case, input to program, n=10=number of values to be investigated

10
1.2
6.5
-2.
7.
0
-7.
5.
0
-2.
+33

Sample case, output of program

Of the 10 values given :
5 were positive with an average of 10.54
3 were negative with an average of -3.6667
2 zeroes were given

Your program should start with comment lines ( add the appropriate info on each line) :

Name               :
ACCESS account ID  :
Project Name       : Introducing if-elsif-else statement
Purpose of program : To determine separately the average of positive and negative numbers and counting the number of zeroes


Zig Herzog; hgn@psu.edu
Send a Note to Zig
Last revised: 09/20/04