Answer to Question #273236 in C++ for Gillani

Question #273236

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

1
Expert's answer
2021-11-29T18:36:55-0500

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





Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS