C programming windows console applicationSolutioninclude inc
C++ programming windows console application
Solution
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
void calcMaterial(double len,double wid,double &mcost);
double calcLabor(double len,double wid);
double calcTotal(double len,double wid);
int main()
{
double len,wid,mcost,lcost,tcost;
cout<<\"Estimate:\"<<endl<<\"Length of Driveway: \";
cin>>len;
cout<<\"Width of Driveway: \";
cin>>wid;
calcMaterial(len,wid,mcost);
lcost = calcLabor(len,wid);
tcost = calcTotal(len,wid);
cout<<\"The cost of material and equipment: \"<<mcost<<endl;
cout<<\"The cost of labor: \"<<lcost<<endl;
cout<<\"The total cost for the job: \"<<tcost<<endl;
return 0;
}
void calcMaterial(double len,double wid,double &mcost)
{
mcost = 45*len*wid;
}
double calcLabor(double len,double wid)
{
return len*wid*6;
}
double calcTotal(double len,double wid)
{
return len*wid*51;
}
