Question: Consider the declaration of the struct houseType given below: struct houseType { string style; int numOfBedrooms; int numOfBathrooms; int numOfCarsGarage; int yearBuilt; int finishedSquareFootage; double

Consider the declaration of the struct houseType given below:
struct houseType
{
string style;
int numOfBedrooms;
int numOfBathrooms;
int numOfCarsGarage;
int yearBuilt;
int finishedSquareFootage;
double price;
double tax;
};
Using houseType using structure, write a complete program with the following functions (you can include or exclude functions of your choice):
void print(houseType[]); // display output on monitor
void print(houseType[], ofstream&); // display in an output file
void readData(houseType&); // read one record of data from keyboard
void readData(houseType[], int); // read a set of data from data file
bool compareHouses(houseType, houseType);
//Compare two houses if at least finished square footages and prices are same then both houses are identical otherwise they are different
Write a test program to test your functions for the following data file:
Two-Story 54320123670389000.008960
Single-Story 322200314501350002250
Split-Condo 322199916301653002670
Single-Story 422199515501550002960
Single-Story 222199012501050002160
Two-Story 44320064170399000.009980
Split-Condo 222198911301153002270
Rewrite the above program using Class (OOP) and test your program. Remember, output must be the same for both programs. In C++

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!