Help Please

How can I get the house listing to print only once and then print the customers that match the correct sales price with budget?

I've tried a view different loops, but can't seem to get it right. Right now the binary search is working correctly and prints out the customer that matches the correct sales price. However, the requirement is to get the house listing to print right once and then the customers underneath it.

Hope that makes sense.

Here is the section I'm having trouble with

// calling function to find matches for each house to a customer
Subscript = FindIt(info, max, Budget);

// if found display out to screen
if(Subscript != -1)
cout << info[Subscript].HouseAddress << " " << info[Subscript].StreetName << " " << info[Subscript].SalesPrice
<< " " << info[Subscript].ListingNumber << " \n";

cout << FirstName << " " << LastName << " " << PhoneNumber << " " << Budget << " \n\n";
// Tells the user that the houses in the report don't match
// their customers budget
cout << "New listings aren't a match for your customers" << endl;

CustomerIn >> FirstName >> LastName >> PhoneNumber >> Budget;


Thanks for your help
It looks to me like the you're going about this in the incorrect order. Instead taking the customer info and matching it to the houses, you'd want to take the house info and match it to the customers.

I'm under the impression you want multiple customers listed under one house listing, instead of one customer listed under multiple houses.
Last edited on
Topic archived. No new replies allowed.