Arrays

This is intended as a group project, but it can also be done by one person, writing one step at a time.

The goal of this project is to create a menu driven program that manipulates parallel arrays of employee information. The maximum size of the array will be 40.

Groups:

To start, break up into groups of 2 or 3. Each group will write one of the functions, save the text, and then add that function to the one program that is a combined effort.

Individuals:

Start with the basic program and add each function one at a time.

It is important to test after adding each function.

  1. The main program will have three arrays: employees (last name only), rate (hourly rate for each employee, gender (a character 'M' or 'F' for each employee. A variable employCount will have the actual number of employees in the array. A main loop calls menu and loops until menu returns 0.
  2. Print all: list all of the employees in columns for last, rate, and gender. Format the rate to 2 decimal places.
  3. The menu: shows the choices, inputs the choice and executes the corresponding function. Will return 0 if the user selects quit. Otherwise it will return 1.
  4. Read in a file with the employee data and populate the arrays and set the value of the counter.
  5. Print a list of all the women and the average rate, and then print all of the men and the average rate.
  6. Give each employee a raise. Ask the amount of the raise and adjust each rate by that amount.
  7. Add a new employee: Ask the name, rate and gender of the new employee and add to the arrays. Adjust the count accordingly.
  8. Search the array for a name. Return the position in the array where the employee was found, or -1 if not found.
  9. Give a raise to one employee: Ask the name, call search. If found set the new rate for just that oneĀ  employee.

NEXT: Project flow charts