Assume you are looking to buy a house in a new development. After looking at various models, the three models they like are majestic, split-entry, and single-story.The builder gave them the base price and the finished area in square meters of three models. They want to know the model(s) with the least price per square feet. Write a program that accepts as input the base price and the finished area in square meters of the three models. The program outputs the model(s) with the least price per square meter.
1
Expert's answer
2012-07-05T07:27:40-0400
// Q.cpp : Defines the entry point for the console application. //
int main(){ house h[20]; int ch=0; int coutnofhouse=0; for(int i=0;i<3;i++){ printf("1 - Majestic "); printf("2 - Split-entry "); printf("3 - Single-story "); printf("0 - Show information "); printf("Select model: "); scanf("%d",&ch); switch(ch){ case 1: h[coutnofhouse].type="Majestic"; break; case 2: h[coutnofhouse].type="Split-entry"; break; case 3: h[coutnofhouse].type="Single-story"; break; } printf("Enter the base price: "); scanf("%f",&h[coutnofhouse].cost ); printf("Enter the finished area in square meters: "); scanf("%f",&h[coutnofhouse].squaremeter); coutnofhouse++; } printf("Model price per square meter "); for(int i=0;i<3;i++){ printf("%s ",h[i].type.c_str()); printf("%.2f ",h[i].cost/h[i].squaremeter); } int i=0; scanf("%d",i);
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
You're welcome. We are glad to be helpful. If you really liked our service please press like-button beside answer field. Thank you!
Thanks a lot:)
Leave a comment