Write a C++ program to find the area, cost of the building and to find whether the budget is sufficient for his work.
STRICTLY FOLLOW QUESTIONS AND TEMPLATES. MAKE CODE ACCORDING TO THE TEMPLATE PROVIDE AT THE END OF THE QUESTION. MATCH INPUT AND OUTPUT AS IT IS.
--------------------START----------------
Write a C++ program to find the area, cost of the building and to find whether the budget is sufficient for his work.
Strictly adhere to the Object-Oriented specifications given in the problem statement. All class names, member variable names, and function names should be the same as specified in the problem statement.Create separate classes in separate files.
The class Building has the following private data variables.
Data Type | Variable Name |
float | length |
float | width |
float | ratePerSquareFeet |
Declare the following member function inside the Building class.
Member Function | Description |
void calculateAreaAndCost (float length, float width, float ratePerSquareFeet, int budget) | To calculate and display the area and the cost per square feet for the Building. If the cost of the building is less than or equal to the budget, then display ‘Yes, you can build within your budget’, else display ‘No, your budget is not sufficient’ |
In the main() method, read the details from the user in the console and display area, cost and suitable for budget or not by calling the calculateAreaAndCost method.
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output 1:
Enter the length covered by the Area in feet :
100
Enter the width covered by the Area in feet :
250
Enter the Rate Per Square Feet :
230
Enter your budget :
3000000
Area of the Building : 25000.00
Cost for Building : 5750000.00
No,your budget is not sufficient
Sample Input and Output 2:
Enter the length covered by the Area in feet :
300
Enter the width covered by the Area in feet :
100
Enter the Rate Per Square Feet :
300
Enter your budget :
10000000
Area of the Building : 30000.00
Cost for Building : 9000000.00
Yes,you can build within your budget
----------------END--------------------
IN ATTACH IMAGE TEMPLATE IS PROVIDED FOR THE " MAIN.CPP AND BUILDING.CPP ". KINDLY CHECK BEFORE MAKING CODE
Step by step
Solved in 2 steps with 2 images