/* Computes and prints gross pay and net pay given an hourly rate and number of hours worked. Deducts a tax of $25 if gross salary exceeds $100; otherwise, deducts no tax. */ #include const float TAX_BRACKET = 100.00; const float TAX = 25.00; // The following line is something called a prototype; we will learn // about this in class. void instruct_pay(); int main() { float hours, rate; // input variables for hours worked and the pay rate float gross, net; // computed values for the gross pay and net pay instruct_pay(); cout << "Hours worked> "; cin >> hours; cout << "Hourly rate> "; cin >> rate; gross = hours*rate; // Compute net salary if (gross > TAX_BRACKET) { net = gross - TAX; } else { net = gross; } cout << "Gross salary is $" << gross << endl << "Net salary is $" << net << endl; return(0); } // Since this function does not return any value then we subsitute // the word void...once again we'll cover this in class. void instruct_pay() { cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(2); cout << "This program computes gross and net salary." << endl; cout << "A tax amount of $" << TAX << " is deducted"; cout << "for an employee who earns more than $" << TAX_BRACKET << "." << endl; cout << "Enter hours worked and hourly rate" << endl; cout << "on separate lines after the prompts." << endl; cout << "Press after typing each number." << endl; return; }