A moving contractor wants you to write a program that he can use to estimate the cost
of moving a residential customer. The charge for moving is based on two factors.
First, the labor cost is estimated by charging $4.00 for every 100 pounds of furniture to
be moved.
Second, the travel charge is $50.00 plus $1.75 for each mile the furniture is to be moved.
The program should prompt the user for the estimated weight of the furniture and the
distance the furniture is to be moved.
Finally, the program should display the labor charge, the travel charge, and the total
charge.
#include<iostream>
using namespace std;
int main()
{
int x,y;
cout<<"Enter the estimated weight of the furniture: ";
cin>>x;
cout<<"Enter the distance the furniture is to be moved: ";
cin>>y;
float c1=(x/100)*4.00;
float c2=(50.00+1.75)*y;
float total_cost=c1+c2;
cout<<"Labour charge is: $"<<c1<<endl;;
cout<<"Travel charge is: $"<<c2<<endl;
cout<<"The total cost is: $"<<total_cost;
}
Comments
Leave a comment