Write a C++ program to find the area, cost of the building and to find whether the budget is sufficient for his work.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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.
 
 
Input and Output format:
Refer to the sample input and output for formatting specifications.
Display the area and cost for building with two decimal points.
 

[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

Main.cpp/
1 #include <iostream>
#include<string.h>
#include "Building.cpp"
using namespace std;
5- int main() {
X
2
3
4
6
7
//Fill your code here
8
return 0;
}
9
10
11
12
13
Transcribed Image Text:Main.cpp/ 1 #include <iostream> #include<string.h> #include "Building.cpp" using namespace std; 5- int main() { X 2 3 4 6 7 //Fill your code here 8 return 0; } 9 10 11 12 13
Building.cpp/
1
#include<iostream>
#include<string.h>
#include<cstdio>
2
using namespace std;
6- class Building {
private:
float ratePerSquareFeet,length, width;
public:
float getlength() {
return length;
}
void setlength(float length) {
this->length=length;
7
8.
10-
11
12
13-
14
15
16-
float getwidth() {
return width;
}
void setWidth(float width) {
this->width=width;
17
18
19 -
20
21
22 -
float getRatePerSquareFeet () {
return ratePerSquareFeet;
}
void setRatePerSquareFeet (float ratePerSquareFeet) {
this->ratePerSquareFeet=ratePerSquareFeet;
}
void calculateAreaAndCost (float length, float width,float ratePerSquareFeet, float budget) {
23
24
25-
26
27
28 -
29
30
//Fill your code here
}
};
31
32
33
Transcribed Image Text:Building.cpp/ 1 #include<iostream> #include<string.h> #include<cstdio> 2 using namespace std; 6- class Building { private: float ratePerSquareFeet,length, width; public: float getlength() { return length; } void setlength(float length) { this->length=length; 7 8. 10- 11 12 13- 14 15 16- float getwidth() { return width; } void setWidth(float width) { this->width=width; 17 18 19 - 20 21 22 - float getRatePerSquareFeet () { return ratePerSquareFeet; } void setRatePerSquareFeet (float ratePerSquareFeet) { this->ratePerSquareFeet=ratePerSquareFeet; } void calculateAreaAndCost (float length, float width,float ratePerSquareFeet, float budget) { 23 24 25- 26 27 28 - 29 30 //Fill your code here } }; 31 32 33
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY