I really think I'm close to really having a grasp on this function stuff. Here's another program I'm writing. Some pointers would be greatly appreciated.
Code:#include <iostream> #include <iomanip> using namespace std; void getData(double, double); void computePay(double, double); void displayNet(double); int main() { double hours = 0; double rate = 0; double netPay = 0; cout << fixed << showpoint << setprecision(2); getData(rate, hours); computePay(rate, hours); displayNet(netPay); return 0; } void getData(double& rate, double& hours) { cout << "Enter rate of pay: "; cin >> rate; cout << endl; cout << "Enter hours: "; cin >> hours; cout << endl; } void computePay(double rate, double hours) { double netPay = rate * hours; cout << endl; } void displayNet(double netPay) { cout << "Net pay: $" << netPay << endl; }



LinkBack URL
About LinkBacks



