for the program listed below, modify it to include a menu that offers the user t
ID: 3638017 • Letter: F
Question
for the program listed below, modify it to include a menu that offers the user the following examples:
1. add an employee
2. modify employee data
3. delete an employee
4. exit this menu
#include <iostream>
using namespace std;
class employee
{
private:
int id, maxHours;
float payRate;
public:
void setInfo (int pin, float pay, int hours)
{
id = pin;
payRate = pay;
maxHours = hours;
}
void viewInfo () // No parameters req.
{
cout << id;
cout << endl << payRate;
cout << endl << maxHours;
}
};
int main ( )
{
int pin, hours, record;
float pay;
employee empInfo[1000];
cout << "Enter employee 3 digit ID: ";
cin >> pin;
cout << "Enter employee pay rate: ";
cin >> pay;
cout << "Enter employee max hours: ";
cin >> hours;
empInfo[pin].setInfo(pin, pay, hours);
cout << "Enter the employee ID# of the record you wish to view: ";
cin >> record;
empInfo[record].viewInfo();
return 0;
}
Explanation / Answer
why are you not rating the previous question ???
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.