Answer:
C++ code is given below
Explanation:
#include<iostream>
#include <cstring>
using namespace std;
int housekeeping(string EOFNAME);
int mainLoop(string name,string EOFNAME);
int finish();
void main()
{
string name;
string EOFNAME = "ZZZZ";
cout << "enter the name" << endl;
cin >> name;
if (name != EOFNAME)
{
housekeeping(EOFNAME);
}
if (name != EOFNAME)
{
mainLoop(name , EOFNAME);
}
if (name != EOFNAME)
{
finish();
}
system("pause");
}
int housekeeping(string EOFNAME)
{
cout << "enter first name " << EOFNAME << " to quit " << endl;
return 0;
}
int mainLoop(string name, string EOFNAME)
{
int hours;
int rate,gross;
int DEDUCTION = 45;
int net;
cout << "enter hours worked for " << name << endl;
cin >> hours;
cout << "enter hourly rate for " << name << endl;
cin >> rate;
gross = hours*rate;
net = gross - DEDUCTION;
if (net > 0)
{
cout << "net pay for " << name << " is " << net << endl;
}
else
{
cout << "dedections not covered.net is 0.";
}
cout << "enter next name or " << EOFNAME << " to quit" << endl;
cin >> name;
return 0;
}
int finish()
{
cout << "end of job"<<endl;
return 0;
}