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. noncompiling (-28) - no documentation(-5) - weak documentation (-3) Not qualifying user input clearly (-2) - Must use an iflelse if/else if (or if else if/else) statement to check for cheapest by square foot. Each should use a logical and, plus 2 relational operators (-4 if not) Having any additional if/else if blocks or multiple if statements (-4) - Incorrect Output (should only have to output the option that is the cheapest per square foot) (-3 for each instance). Run 3 times, making each option the cheapest to ensure proper execution of the if TEST RUNS col = 100000, 1000, split-200000, 1000, single-300000, 1000; col 300000, 1000; split 200000, 1000; single 400000, 1000; col 400000, 1000; split 500000, 1000; single 300000, 1000; OUTPUT IS COLONIAL OUTPUT IS SPLIT-ENTRY OUTPUT IS SINGLE-STORY

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Below is the C++ program that satisfies the above functionality. Please copy the below program in your editor and test.

PriceCalculation.cpp

#include <iostream>
using namespace std;
int main(){
int colonialprice,splitprice,singleprice,
colonialArea,splitArea,singleArea,
colonialTotalPrice,splitTotalPrice,singleTotalPrice;
  
cout<<"Enter Colonial base price :";
cin>>colonialprice;
cout<<"Enter Colonial Finished Area :";
cin>>colonialArea;
cout<<"Enter Split entry base price :";
cin>>splitprice;
cout<<"Enter Split entry Finished Area :";
cin>>splitArea;
cout<<"Enter Single Entry base price :";
cin>>singleprice;
cout<<"Enter Single Entry Finished Area : ";
cin>>singleArea;
colonialTotalPrice =colonialprice *colonialArea;
splitTotalPrice = splitprice*splitArea;
singleTotalPrice = singleprice*singleArea;
if((colonialTotalPrice<splitTotalPrice)&&(colonialTotalPrice<singleTotalPrice)){
cout<<"House type with least price per square foot : COLONIAL";
}else if((splitTotalPrice<colonialTotalPrice)&&(splitTotalPrice<singleTotalPrice)){
cout<<"House type with least price per square foot : SPLIT-ENTRY";
}else if((singleTotalPrice<colonialTotalPrice)&&(singleTotalPrice<splitTotalPrice)){
cout<<"House type with least price per square foot : SINGLE-ENTRY";
}
cout<<endl;
}

Output 1:

Output 2:

Output 3:

Add a comment
Know the answer?
Add Answer to:
C++: Samantha and Vikas are looking to buy a house in a new development. After looking...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • c++ problem You are asked to implement a car ordering system for Bobcats Auto Dealership. This...

    c++ problem You are asked to implement a car ordering system for Bobcats Auto Dealership. This dealership is brand new and only sells one brand of cars with three different models. However, a buyer can add options if they choose. Write a C++ program that allows the user to order a single car with different options. All the options available will be stored in a file called "options.txt" along with their cost. You may assume that the file will not...

  • In C++ Amanda and Tyler opened a business that specializes in shipping liquids, such as milk,...

    In C++ Amanda and Tyler opened a business that specializes in shipping liquids, such as milk, juice, and water, in cylindrical containers. The shipping charges depend on the amount of the liquid in the container. (For simplicity, you may assume that the container is filled to the top.) They also provide the option to paint the outside of the container for a reasonable amount. Write a program that does the following: Prompts the user to input the dimensions (in feet)...

  • Real estate expert Mike Aubrey is a strategist! His objective is always to sell the house....

    Real estate expert Mike Aubrey is a strategist! His objective is always to sell the house. He believes that ineffective sellers need a “reality check” or to realistically assess their situations. The purpose of this assignment is to identify/apply strategic concepts discussed in this class within the show’s context. The assigned episode is no longer available online, so it is summarized below. (If you are interested in viewing current episodes, click on the following link: http://www.hgtv.com/hgtv176/videos/index.html .) The following scenario...

  • Using supply analysis, explain how is supply applied in the article below about Tesla.? Thank you...

    Using supply analysis, explain how is supply applied in the article below about Tesla.? Thank you so much for your help. Factors Affecting Supply (Tesla) The Cost of Production and Cutting Off Unprofitable Vehicle Models In January of 2019, Tesla cut 7% of its workforce to ramp up production of its Model 3 sedans, reducing the price of its products and boosting margins. At the same time, the company discontinued the cheapest versions of its Model S sedans and Model...

  • write a C++program to analyze a small subset of the data that has been collected. See...

    write a C++program to analyze a small subset of the data that has been collected. See file universities.txt .Use precisely seven parallel arrays: one for name of university, one for state, one for city, one for yearly tuition, one for enrollment, one for average freshman retention, and one for the percent of students who graduate with in six years. Note that the percentage of student accepted is not stored.An output file is opened in main() and remains open until the...

  • Please!!! need help asap!!!! write a C++program to analyze a small subset of the data that...

    Please!!! need help asap!!!! write a C++program to analyze a small subset of the data that has been collected. See file universities.txt .Use precisely seven parallel arrays: one for name of university, one for state, one for city, one for yearly tuition, one for enrollment, one for average freshman retention, and one for the percent of students who graduate with in six years. Note that the percentage of student accepted is not stored.An output file is opened in main() and...

  • SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the...

    SYNOPSIS The product manager for coffee development at Kraft Canada must decide whether to introduce the company's new line of single-serve coffee pods or to await results from the product's launch in the United States. Key strategic decisions include choosing the target market to focus on and determining the value proposition to emphasize. Important questions are also raised in regard to how the new product should be branded, the flavors to offer, whether Kraft should use traditional distribution channels or...

  • C Programming - Please Help us! Implementing Load Balancing, the 3 Base Code files are at the bot...

    C Programming - Please Help us! Implementing Load Balancing, the 3 Base Code files are at the bottom: Implementing Load Balancing Summary: In this homework, you will be implementing the main muti-threaded logic for doing batch based server load balancing using mutexes Background In this assignment you will write a batch-based load balancer. Consider a server which handles data proces- sing based on user requests. In general, a server has only a fixed set of hardware resources that it can...

  • Founded in 2006 by Blake Mycoskie, TOMS Shoes was an American footwear company based in Santa...

    Founded in 2006 by Blake Mycoskie, TOMS Shoes was an American footwear company based in Santa Monica, California. Although TOMS Shoes was a for-profit business, its mission was more like that of a not-for-profit organization. The firm’s reason for existence was to donate to children in need one new pair of shoes for every pair of shoes sold. Blake Mycoskie referred to it as the company’s “One for One” business model. While vacationing in Argentina during 2006, Mycoskie befriended children...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT