Answer to Question #264704 in C++ for Bushra

Question #264704

You are required to build a program for ABC Builders, they have various models of houses which are all build on 1 canal area, the three models with costs are

House Models Building Cost Double

Story House 10000000

House with basement 20000000

Single Story 5000000

The property dealer give them the latest prices for area their house covers and the construction price building each model. The price of area is 1 crore, Calculate the total cost of whole house after construction. Suppose you have two users for this program, take input from them and based on their inputs calculate the total cost for their choice of house


1
Expert's answer
2021-11-11T17:32:46-0500
#include <iostream>
#include <iomanip>


using namespace std;




int main()
{
	int ch;
	double totalPrice=0;
	for(int i=0;i<2;i++){
		cout<<"1. Double Story House\n2. House with basement\n3. Single Story\n";
		cout<<"Choose a house model: ";
		cin>>ch;
		double price=0;
		if (ch==1){
			price=10000000;
		}
		else if(ch==2){
			price=20000000;
		}
		else if(ch==3){
			price=5000000;
		}
		cout<<"\nPrice For House = "<<fixed<<setprecision(2)<<price<<"\n\n";
		totalPrice+=price;
	}




	cout<<"\nTotal Price For 2 Houses = "<<totalPrice;
	cin>>totalPrice;
	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