i am supposed to have 2 void functions and 4 value returning functions (including main) to eventually calculate netsalary from calling the specific functions to calculate tax and insurance and receive and display data.... basically i'm wondering what is my error (compiled in dev and couldn't figure out what was wrong with the particular lines)
here's what i did:-
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
void getInput(string &, double&);
double calcFwt(double, double );
double calcFica(double, double );
double calcNetPay(double, double, double, double );
void displayInfo(string, double, double, double);
int main ()
{
string name = " ";
double wkPay = 0.00;
double fwt = 0.00;
double fica = 0.00;
double netPay = 0.00;
cout << fixed << setprecision (2);
getInput (name, wkPay);
fwt = calcFwt (wkPay, fwt);
fica = calcFica (wkPay, fica);
netPay = calcNetPay (wkPay, fwt, fica, netPay);
displayInfo (name, fwt, fica, netPay);
void getInput (string & name, double & wkPay);
{
cout << "Customer name: ";
getline (cin, name);
cout << "Enter customer weekly salary: ";
cin >> wkPay;
}
double calcFwt (double wkPay, double fwt);
{
return fwt = 0.20 * wkPay;
}
double calcFica (double wkPay, double fica);
{
return fica = 0.08 * wkPay;
}
double calcNetPay (double wkPay, double fwt, double fica, double netPay);
{
return netPay = wkPay - (fica + fwt);
}
void displayInfo (string & name, double & fwt, double & fica, double & netPay);
{
cout << "Customer name: " << name << endl;
cout << "FWT is: " << fwt << endl;
cout << "FICA is: " << fica << endl;
cout << "Net Pay is: " << netPay << endl;
}
}