1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
#include <iostream>
#include <iomanip>
using namespace std;
void getInput(double, double&, double&);
double computeArea(double length, double width);
void computeCosts(double& area,double& carpetCost);
const int INCHESPERSQUARE=144;
int main(){
double width, length, carpetCost,totalArea,totalInstallcost;
cout<<"\t\tAce Carpet Company Cost estimate\n\n";
//getInput(width,length,carpetCost);
cout<<"The area in square feet is: "<<totalArea;
cout<<"The cost of the carpet is: "<<carpetCost++<<endl;
cout<<"The cost to install the carpet is "<<totalInstallcost++<<endl;
}
void getInput(double &width, double length, double &carpetCost)
{ //double width, length, carpetCost;
cout<<"please enter the width: "<<endl;
cin>>width;
while(width<=0)
{cout<<"Error, please enter a width with a postive value: ";
cin>>width;}
cout<<"please enter the length: "<<endl;
cin>>length;
while(length<=0)
{cout<<"Error, please enter a length with a postive value: ";
cin>>length;}
cout<<"please enter the price of the carpet: "<<endl;
cin>>carpetCost;
while(carpetCost<=0)
{cout<<"Error, please enter a price with a postive value: ";
cin>>carpetCost;
cout<<"please enter the install cost<<install cost--";
cin>>"instal cost"}
while(width<=0,length<=0,carpet cost<=0);
return(0);
while(width>>0,length>>0,carpetcost>>0);
return(carpet cost);
}
|