CS151 -- Programming Fundamentals

Project 2
 


Due: Thursday June 28, Midnight

    Write an employee tracking program.  Effectively what this means is that you have to write a program that will take an employee name (string, first and last name), id number (integer), salary per year (double), and title (string), and store them away, then, ask the user if he/she would like to make any changes to the input, should they answer yes, then the program will allow the user to 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 the employee information in a readable format...  If the employee's title is Manager, the user may not edit the entry.

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 only the first 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.

Example 1:
 

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

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

I am sorry, Managers may not be modified...
 

Employee Information

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

Example 2:

% tracker
Name: Thomas Fields
Id: 15243
Salary: 36519.00
Title: Programmer

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

Modify Data, leaving entry blank will not change the information:

Name:
Id: 15244
Salary:
Title:

Employee Information

Name: Thomas Fields
Id: 15244
Salary: $36519.00
Title: Programmer