Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Objectives: You want to buy a house in a certain neighborhood. You received an input file named input.txt that contains all the houses for sale
Objectives: You want to buy a house in a certain neighborhood. You received an input file named input.txt that contains all the houses for sale in this neighborhood. The input file contains the following information about the houses: The style of the house Number of bedrooms Number of bathrooms Number of garages . . . . . . Year built Square footage Price of the house Design an algorithm and write a C++ program that do the following: Define a class that holds the data about the houses The class must have private and public members . . . . Read the data about the houses from the input file Output the data to the screen as illustrated in the sample solution Find and output the house with the lowest price Sample Run List of Houses on Sale: Style #Bedrooms #Bathrooms #Garages Year Footage Price Bungalow 1964 2055 250906 Colonial 1990 1950 350999 Cottage 1976 1720 279080 Craftsman 2180 eBeest Ranch 1985 3510 998080 Neoclassical 2004 1840 650999 Victorian 1952 1306 210060 Slatbox 2014 1260 319060 AHNPOPNU Prairie 2018 1790 420080 QueenAnne 1987 2320 470060 Monterey 2013 1680 325060 Neoclassical W UT W U 2014 2175 740900 Bungalow 2007 1690 375090 Craftsman 1999 1940 299000 Monterey 2016 2035 480909 The house with the lowest price is Victorian 3 1 1952 1300 210900Task 1: The history teacher at your school needs help in grading a True/False test. The students' IDs and test answers are stored in a file. The first entry in the file contains answers to the test in the form: TFFTFFTTTTFFTFTFTFIT Every other entry in the file is the student ID, followed by a blank, followed by the student's responses. For example, the entry: ABC54301 TFTFTFTT TFTFTFFTTFT indicates that the student ID is ABC54301 and the answer to question I is True, the answer to question 2 is False, and so on. This student did not answer question 9. The exam has 20 questions, and the class has 4 students. Each correct answer is awarded two points, each wrong answer gets one point deducted, and no answer gets zero points. Write an algorithm and a C++ program that uses dynamic arrays and processes the test data. The output should be the student's ID, followed by the answers, followed by the test score, followed by the test grade. Assume the following grade scale: 90%-100%, A; 80% 89.99%, B: 70%-79.99%, C; 60% 69.99%, D; and 0% 59.99%, F. Sample output: Processing Data Key: TTFTFTTTFTFTFFTTFTIF Student ID Student Answers Score Grade ABC54102 T ETETETTTETTETTF TF 27 D DEF56278 TTETETITETETEETTETTE 40 ABC42366 TTETETTTETETFFTTF 34 B ABC42586 TTTTETIT TETEFFTF 26 Process returned 0 (0x0) execution time : 0.078 s Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started