heres some help, i'm bored
/* this was posted while it was still in the c++ forum, so its in C++, its only to help you, its not a solution to your problem.
*/
Code:
/* Steven Billington
December 20, 2002
NatPine.cpp
Program finds netpay for employees.
*/
#include "stdafx.h"
#include <iostream.h>
#include <iomanip.h>
/* Prototype functions*/
double find_gross(double &worked, double &rate);
double find_net(double &grosspay);
/* Const for deductions*/
const double FED_TAX = 0.18;
const double S_TAX = 0.045;
const double HOSP = 26.65;
const double UNION = 7.85;
int main(int argc, char* argv[])
{
/* Input/function calls*/
double hours,
hr_rate,
gross,
net_pay;
cout<<setiosflags(ios::fixed | ios::showpoint | ios::right)
<<setprecision(2);
/* Prompt user*/
cout<<"Enter hours: ";
cin>>hours;
cout<<"Enter rate: ";
cin>>hr_rate;
/* Call function*/
gross = find_gross(hours,hr_rate);
cout<<"\nGross hours worked: "<<"\t"
<<gross<<endl;
/* Call function, output return*/
cout<<"\nNet pay is: "<<"\t\t"
<<find_net(gross)<<endl;
return 0;
}
/* Function definition*/
/* Function finds gross pay based on user
given values*/
double find_gross(double &worked, double &rate)
{
double gross_pay;
gross_pay = worked * rate;
return gross_pay;
}
/* Function Declaration*/
/* Function finds net pay based on return
of find_gross function by making
deductions*/
double find_net(double &grosspay)
{
double net_is,
percent_loss;
percent_loss = grosspay * FED_TAX;
grosspay -= percent_loss;
percent_loss = grosspay * S_TAX;
grosspay -= percent_loss;
grosspay -= HOSP;
grosspay -= UNION;
net_is = grosspay;
return net_is;
}