Answer to Question #178248 in C++ for Mashhood

Question #178248

A carpenter wants to make a ladder, but he want to calculate the required wood for it. The distance

between each step is 1 foot. Write a C++ program in which, take the length and width of ladder as input

from user and calculate the required wood. Price of wood is 500 per foot, now calculate the price of

wood as well.

Example:

Input: Output:

Enter the length of ladder in foot: 25

Enter the width of ladder in foot: 2

Required wood in foot: 98

Cost of wood is: 49000


1
Expert's answer
2021-04-04T17:28:46-0400
#include <iostream>
using namespace std;

int main() {
int length,Width,result,money;
   cout << "Enter the Length of ladder in foot: " ;
   cin >> length;
   cout << "Enter the Width of ladder in foot: " ;
   cin >> Width;
  
   result=length*Width*1.96;
   money=result*500;
  
   cout<<"Required wood in foot: "<<result<<endl;
   cout<<"Cost of wood is :"<<money;
  
   return 0;
}

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