P03 Pseudocode |
|
Pseudocode similar to this was developed in class for P03.
//P03 Name TR 1:00pm
//Brief description of program, data validation, and overtime
#include <iostream>
using namespace std;
void main()
{
declare constants
declare variables
set decimal formatting
do
{
prompt for and get rate
}while (rate < 10.00 || rate > 15.00);
initialize hours to zero
while (hours < 1 || hours > 50)
{
prompt for and get hours
}
//calculate gross
if (hours > 40)
gross = (40 * rate ) + (hours - 40) * rate * OVERTIME_RATE;
else
gross = hours * rate;
calculate taxes, netpay, and netHourly
display the results
}
//end of main