CIS 435 Lab 2

Points: 20 Due Date: Friday December 12, 2003

In this lab, you will practice with loops, conditional statements and simple I/O. This is exercise 3.5 on page 113 of our book. Write a program that will read an unspecified number of integers and find the total and average of all the numbers entered. Don't count zero. Do print the numbers as they are entered. HINT: no arrays are needed. The program stops reading and outputs the results when a zero is entered. Use floating point numbers for the average. Watch out for divide by zero.

You can construct this as a single class that also contains the main() method.


You should turn in a listing of the program. Staple the cover sheet to that.


Think about how you will do this so you can ask questions.
ASK if you have any questions.