A carpenter wants to make a bed set; he wants to calculate the required wood for it. 10.5 sq foot wood
required for side tables. 15 sq foot required for dressing table and 35.75 sq foot wood required for bed.
Cost of each sq foot is 5000. Write a C++ program in which, take number of bed set required and calculate
the total required wood and total cost of wood.
Example:
Sample input:
Enter required number of bed set: 3
Sample output:
Total bill is: 918750
Source code
#include <iostream>
using namespace std;
int main()
{
double side_tables=10.5 ;
double dressing_table=15;
double bed=35.75;
double total_wood=side_tables+dressing_table+bed;
int n;
cout<<"\nEnter required number of bed set:";
cin>>n;
double total_cost=n*(total_wood*5000);
cout<<"\nTotal required wood: "<<total_wood;
cout<<"\nTotal cost of wood: "<<total_cost;
return 0;
}
Output
Comments
Leave a comment