subject

This assignment involves creating a program to track employee information. Keep the following information on an employee: Employee ID (string)
Last name (string)
First Name (string)
Birth date (string as MM/DD/)
Gender (M or F, single character)
Start date (string as MM/DD/)
Salary per year (double)
Thus you must create a class that has all of this, and get/set methods for each of these fields. Note: The fields that are designated as string should use the string class, not a char array.
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. You may not use vectors. If the file does not exist, your program will create it in step 5, below.
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. While some input validation would be good, the only requirement is that the data not be null and that the salary must be a valid floating-point number greater than zero. (Doing proper input validation is beyond the scope of this exercise and could easily double the size of the program. Dates, in particular, are difficult to validate.)
Display all employee information in alphabetical order by last name. 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. (You can use printf for this if you like.) 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. Ask for an employee ID, and if the ID exists, delete. If not, display a message that there is no such 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. If the file exists, overwrite it. If it does not exist, create it.
Invalid menu options will display a message and return to show the menu. After executing options 1 through 4, return to the menu. Option 5 saves and exits.
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 somewhere in your program to write them all out, with each piece of data separated by a blank, with one employee per line.
Structure: Three files, called Employee. h, Employee. cpp. and main. cpp.
Do not do the following:
Method in Employee that does I/O including display.
Not using pointers to objects.
Use of Vectors.
Not closing files that have been opened.
Not freeing allocated memory.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:30
Communication is the exchange of information. true false
Answers: 2
question
Computers and Technology, 23.06.2019 21:30
Examine the list below. which factors positively affect lifetime income? check all that apply.
Answers: 1
question
Computers and Technology, 25.06.2019 01:00
When a new name is registered on the internet, the process can take two hours to four hours four hours to three days two hours to two days one hour to eight hours
Answers: 1
question
Computers and Technology, 25.06.2019 01:20
Jason typically uses the internet to buy various items. it the total cost of all of the items ordered, at one time, is $250 or more, then the shipping and handling is free, otherwise the shipping and handling is $15 per item. design an algorithm that prompts jason to enter the number of items ordered and the price of each item. (remember cost = number of items order times price) the algorithm then outputs the total billing amount including shipping and handling. your algorithm must use a loop (repetition structure) to get the number and price of each item. write this in algorithm format not program code format.
Answers: 2
You know the right answer?
This assignment involves creating a program to track employee information. Keep the following inform...
Questions