Why won't this program execute?
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
// Global variables
double hours, pay_rate, regular_pay;
double overtime_pay, Gross_Pay, Net_Pay;
double tax = .055;
// The functions receive no parameters and return no results.
// All communication is through the global variables.
void Calculate_Gross_Pay();
void Calculate_tax();
void Calculate_Net_Pay();
void Display_Results();
cout << setprecision(2)
<< setiosflags(ios::fixed)
<< setiosflags(ios::showpoint);
do
{
cout << "Enter the person's pay rate: ";
cin >> pay_rate;
cout << "Enter the person's number of hours worked: ";
cin >> hours;
void Calculate_Gross_Pay();
if (hours > 40.0)
{
regular_pay = hours * pay_rate;
overtime_pay = (hours - 40.0) * 1.5 * pay_rate;
}
else
{
regular_pay = hours * pay_rate;
overtime_pay = 0.00;
}
Gross_Pay = regular_pay + overtime_pay;
//Calculate Tax
tax = tax * Gross_Pay;
//Calculate net pay
Net_Pay = Gross_Pay - tax;
//Display results
cout << endl << endl;
cout << "Regular Pay: " << setw(7) << regular_pay << endl;
cout << "Tax: " << setw(7) << tax << endl;
cout << "Gross Pay: " << setw(7) << Gross_Pay << endl;
cout << "--------------------" << endl;
cout << "Net Pay: " << setw(7) << Net_Pay << endl;
}
return 0;
}
Tags: