// This pseudocode is intended to display // employee net pay values. All employees have a standard // $45 deduction from their checks. // If an employee does not earn enough to cover the deduction, // an error message is displayed. // This example is modularized. start Declarations string name string EOFNAME = "ZZZZ" while name not equal to EOFNAME housekeeping() endwhile while name not equal to EOFNAME mainLoop() endwhile while name not equal to EOFNAME finish() endwhile stop housekeeping() output "Enter first name or ", EOFNAME, " to quit " return mainLoop() Declarations num hours num rate num DEDUCTION = 45 num net output "Enter hours worked for ", name input hours output "Enter hourly rate for ", name input rate gross = hours * rate net = gross - DEDUCTION if net > 0 then output "Net pay for ", name, " is ", net else output "Deductions not covered. Net is 0." endif output "Enter next name or ", EOFNAME, " to quit " input name return finish() output "End of job" return

Respuesta :

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;

}

ACCESS MORE