CS151 -- Programming Fundamentals

Project 4
 
 
 

Due: Tuesday July 17, 11:59pm

    Write an employee tracking program.  Effectively what this means is that you have to write a program that will take at most ten entries from a file, consisting of: an employee name (a string, consisting of a first and last name), id number (integer), salary per year (double), and title (string), and finally a string which will be yes or no, as to whether they wish to continue entering data, each.  It should store these such that they will be accessable later in the program, and then, continually, ask the user if he/she would like to make any changes to the input, should they answer yes, the user may modify the entry (if the input is nothing (i.e. only a newline) then leave the entry unchanged).  Your program should accept either yes, y, no, or n as valid for the answer to the question.  Following this, the program will output all three employee's information in a readable format...  If the employee's title is Manager, the user must also enter the employee's id number in order to modify the employee information. When asking the user to modify an employee, you must ask the user for the name of the employee which he/she wishes to modify, and only modify that particular employee's information.

Notes:

  1. Your program should use functions, as there are several conceptual separations in this program.
  2. You will also note that this program will be an ongoing assignment, this is now, the second step.
  3. A hint is that the input at the first part of the program and the input at the modification stage look quite similar in the examples below.
  4. Global variables are acceptable for this program.
  5. You should use at least one class in this assignment.
Example 1:
 

% tracker
Reading employee information...

Would you like to modify an employee (yes/no)?
yes

Which employee do you wish to modify?
David Johnson

For a manager, you must also enter the id number of the employee: 98375
That is not correct!

Would you like to modify this entry (yes/no)?
no

Employee Information

Name: David Johnson
Id: 35718
Salary: $56078.98
Title: Manager

 (output for all other employees)
 
 
 
 

Example 3:
 

Reading employee information...

Do you want to modify this data?
yes

Which employee do you wish to modify:
John Doe

Name:
Idnum:
Title: manager
Salary: $

Do you want to modify this data?
no

(output of all employees' information...)