You have to create two classes. The first class “Employee” which included:
The private variables:
first name
last name
id number (Format: A#####)
Wage
hoursWorked

The hoursWorked variable holds how many total hours the person worked. When the hoursWorked is over 40 hours, it will be considered as over time. Wage holds how much the person makes per hour. After passing the 40 hours, they get 1.5 x the wage for each additional hour worked.
The functions:
Constructors
Properties
GetGrossPay: calculate the gross pay for the employee (Be careful with the over time)

The second class will be “EmployeeDemo” class with the main function. In the main function, Read the data from the “employeeinfo.txt” file and save the data in the array of (Employee) objects. In the file, the first number is the total number of employees and each employee’s information.
After import the data, display a menu for user to choose:
1.Display all employees
2.Add New employee
3.Quit the program (save the information to “employeeinfo.txt” file)

Display Example:

John        Wu          A00001  $906.25
Bob         Ho          A00002  $420
Jenny       Pena        A00003  $561.88
Sam         Sosa        A00004  $420
Linda       Jordan      A00005  $1019.88

Recommended Answers

All 2 Replies

What do you have so far?

So what's the exact question? Do you need help imporing ot exporting? or what?

The way you wrote this, it looks like a school assignment. If that is the case you are out of luck here. DaniWeb is a forums that helps answer questions, not write your assignment for you. If you have a question like "how might I do this", or "why do I get this error" and stuff like that we can help me. But make sure you aren't just asking us to do work for you. You should show you put some effort into it, either with possible written code, or things like theories you might have on how to approach it, ext.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.