Victor and Francis are looking to buy a house in a new development.After looking at the several of models,the three models they like are colonial,split-entry and single-story. The builder gave them the base price and the finished area in square feet of the three models.They want to know the model(s) with the least price per square foot.
Write:
a.Problem Analysis
b.Algorithm
c.Flowchart
d.Pseudocode
e.Complete C++ program
f.Output
#include <iostream>
#include <cctype>
#include <limits>
int main()
{
std::cout << "Do you want someone to do all the work for you? ";
char answer{};
std::cin >> answer;
// Ignore to the end of line
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
if (std::toupper(answer) == 'Y' ) { std::cout << "Post it in the Jobs section.\n"; }
else { std::cout << "Show what have you coded so far.\n"; }
std::cout << "Good luck.\n";
}
if ((priceColo <= priceSplit) && (priceColo <= priceSingle))
cout <<"Colonial house is the cheapest one. \n" <<endl;
else if ((priceSplit <= priceColo) && (priceColo >= priceSingle))
cout <<"Split-Entry house is the cheapest one. \n" <<endl;
else if ((priceSingle <= priceSplit) && (priceSplit >= priceColo))
cout <<"Single-Storey house if the cheapest one. \n" <<endl;
Well a - d should have been done before you even started to write your program. You have a program so now all you need to do is compile and run it to find out the output (f).