Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CS1 Spring 2017 Assignment 5: Simple Employee Tracking System This assignment involves creating a program to track employee information. (In C++) Keep the following information

CS1 Spring 2017

Assignment 5: Simple Employee Tracking System

This assignment involves creating a program to track employee information. (In C++) Keep the following information on an employee:

Employee ID (string)

Last name (string)

First Name (string)

Birth date (string as MM/DD/YYYY)

Gender (M or F, single character)

Start date (string as MM/DD/YYYY)

Salary per year (double)

Thus you must create a class that has all of this, and get/set methods for each of these fields. Your class must have three constructors:

No arguments. Just construct an object.

Takes only an employee ID

Takes all information

When the program starts it must check to see if a file called Employee.txt exists. If it does, read the information into Employee objects which you dynamically allocate and put them into an array of pointers to objects. Data in the file is stored separated by spaces, one employee per line. Assume the company will have no more than 100 employees, but if it does, show an error. No vectors for this one.

The program will have a menu that shows the following options:

Enter new employee information. When the ID is entered, make sure that ID is not in use for another employee. Request the rest of the info and create a new Employee object.

Display all employee information in alphabetical order. The list may not have been entered in order, but you must sort it to display it. Show the information in fixed-field columns so that it looks neat. Show the salary to the nearest dollar.

Look up an employee by ID. If the ID exists, show all of the information. If not, display a message.

Remove an employee. This should delete the object pointer from your array and remove the Employee object from memory. (How do you handle this in the array?)

Save all data to Employee.txt and exit.

Invalid menu options will display a message and return to show the menu. After executing options 1 through 4, return to the menu.

The Employee class will not have a method to write all of the employees to the file, since it does not know about more than one employee at a time. However, you will have a method to write them all out, with each piece of data separated by a comma and one employee per line.

To hand in: Three files, called Employee.h, Employee.cpp. and Asg5.cpp.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

More Books

Students also viewed these Databases questions

Question

Which of the following can a PostgreSQL database contain?

Answered: 1 week ago