CIS 327 Lab 1

Points: 30 Due Date: Monday July 28, 2003

This project will involve arrays and functions, but it will also be more practice with control structures. First, create an array of integers. Then load these arrays with some data. For example, put your phone number + area code in it. The only constraint on the numbers it that they should be both odd and even and not in order. So, 16303931788 is fine, 123456789 (sequential) is not, neither is 13033795391 (all odd).

Now, write a loop that prints the numbers in the array. I don't care if you print them one per line or all on a line. Next, you will loop over the array and copy the odd numbers to a second array. To find out if a number is odd or even, you will write a small function that takes an integer as an argument and returns a Boolean. Use that in the loop to decide if the number is odd or even. As a hint

		int a = 3/2;
		cout << a << endl;
Try that and see what happens.

Lastly, print the numbers that got copied into the second array. You need to keep track of how many you copy so you only print that many in the second array.

Deliverables:

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

Notes

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