eecs 233 hw1c

eecs 233 hw1c - Characters integers which are larger than...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
EECS 233 / Summer 2006 Homework 1c Design Document Benjamin Horstman The assignment was to implement an integer data array of size exactly 9. I used I implemented a class,, which has an integer array as one of its member variables. It also includes functions which add new ints into the correct place in the array, print the array, and calculate the mean and median. The value of 9 is always passed to the constructor of ac, thus an array of length 9 is always created. The program reads integers from a file “C:\test.dat.”
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Characters, integers which are larger than int can hold, and files which contain more than 9 integers will cause exceptions. The file not found exception is handled as in the handout. The integers are read in sequentially and placed into the correct position in the array using a member function of class ac. If less than 9 ints are present in the file, the program still operates correctly. The array is also printed every time a new integer is added to it. At the end, the mean and median are also printed in a similar fashion....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online