Browsing daniweb for a couple weeks and you guys really help but in this lab me and my partners were a bit stumped, the purpose was to pass one set through pointers and the rest arrays. In my opinion a bit silly but whatnot, here's the latest code (we have everything its just not working) my partner sent me, email messes it up. Thanks
#include <iostream>
#include <iomanip>
using namespace std;
const double LABOR_COST = 0.35;
const double TAX_RATE = 0.085;
double getData(double *length, double *width, double *discount, double
*carpetCost);
double calculate();
void printResults();
double calculateInstall(double &area, double &carpetCost);
double calculateSubtotal();
double calculateTotal;
int main()
{
double area;
double length, width, discount, carpetCost;
double labor, installPrice;
getData(&length, &width, &discount, &carpetCost);
area = length * width;
// calculate(calculateInstall, calculateSubtotal, calculateTotal);
calculateInstall(labor, installPrice);
cout << "Labor cost is: " << labor << endl;
cout << "Install Price is: " << installPrice << endl;
cout << endl;
return 0;
}
double getData(double *length, double *width, double *discount, double
*carpetCost)
{
cout << "Length of room (feet):\t\t";
cin >> *length;
cout << "Width of room (feet):\t\t";
cin >> *width;
cout << "Customer discount (percent):\t";
cin >> *discount;
cout << "Cost per square foot:\t\t";
cin >> *carpetCost;
cout << endl;
return *length, *width, *discount, *carpetCost;
}
double calculateInstall(double &area, double &carpetCost)
{
double labor, installPrice;
labor = area * LABOR_COST;
installPrice = area * carpetCost;
return labor, installPrice;
}