Lab 11: The one after ten

This is lab 11. This is the 11th lab in a series of many labs. This being the 11th lab, we will now shift our attention to Dynamic Memory. (Welcome to the Dark Side)

Details

The details for this lab are top secret. No, not really. All you have to do is make an array of ints that is dynamically allocated. Start the array at size 10 and every time you grow your array, just double the size. The input to the program will simply be a series of ints each on a separate line. When you are done reading the ints, you will simply say what the current size is, what the current count is, and then just print each int on a separate line.

Input

The input is simple. Here's what it might look like:

1
2
3
4
5

Output

The output isn't much harder, for this we simply state the current size, count and then print the ints.

Size: 10
Count: 5
1
2
3
4
5

So the size is how large the array currently is. The count is how many ints are actually stored in the array.

Requirements

There are only a few basic requirements for this lab.

  1. You must put your function signature in a file called dynamic.h
  2. You must have the function signature void dynamic( istream& in, ostream& out );
  3. Your initial size for the array is 10.
  4. You must double you array when you grow your array.

Grading

Zip up your dynamic.h and your implementation file and turn them into Web-CAT.

Due

Like all labs this is due at the end of lab on Tuesday, November 11 at 6:50PM. I will accept this lab until Friday, November 14 at 11:50AM.