C++: Samantha and Vikas are looking to buy a house in a new development. After l
ID: 640998 • Letter: C
Question
C++: Samantha and Vikas are looking to buy a house in a new development. After looking at various 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 program that accepts as input the base price and the finished area in square feet of the three models. The program outputs the model(s) with the least price per square foot.
Explanation / Answer
price/square_meters=conainter/vector/dequeue.
price = float/int.
square_meters = float/int.
for (i=0;i<3) do
ask_for_input;
price <- price_input;
square_meters <- square_meters_input;
price/square_meters.push_back() <- price/square_meters;
end_for
min=float/int;
min <- price/square_meters[0];
for (i=1;i<3) do
if (min<price/square_meters[i]) then
min=price/square_meters[i];
end_if
end_for
print min;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.