Assignment #6 - Array Practice

Due: Wed, Nov 16

Objective

To gain practice with arrays and common array algorithms, as well as the use of array parameters in functions.

Task

This assignment will consist of writing several functions that manipulate arrays or access data from arrays, as well as a test program that will allow interactive testing of the array functions.

Part 1: Functions

Write the following functions. Each one takes in an integer array as a parameter, and other necessary parameters are returns are described. Make sure the parameters are in the order specified. Make sure to use the const qualifier on the array parameter on any function where it is appropriate. A sample CALL is given for each function. Note that none of these functions do any keyboard input or screen output.
 

Part 2: Test Program

To help you test and get you started, I've provided you with a starter file, which you can download from this link. The starter file already contains the PrintArray function that we looked at in lecture class, as well as a function called FillArray that allows the user to enter values into an array from the keyboard. You may use these functions in writing the following test program.

Write a main() function that creates an array of size SIZE (a constant given in the starter file). Since this is a constant, it can be changed for testing different sizes of arrays easily. Use this constant whenever referring to the array's size from main() (instead of using a hard-coded literal value).

Then, the program should go into a menu loop, presenting the user with the following menu the first time:

	** Given features **
 P	Print the array contents
 F	Fill the array (user entry) 

	** Function Tests **
 I	Insert
 D	Delete
 R	Reverse
 H	HowMany 
 S	SumOdds

 M	Print this menu
 Q	Quit this program
Hint: A good way to implement a menu loop is a switch statement (for processing a menu selection) inside of a do-while loop (for repeating the menu selection process).
 

General Requirements


Submitting:

Program submissions should be done through the submission web page, linked from the main course web site. Submit the file:
 hw6.cpp