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;