Okay, so I am not expecting a whole source code (although I'd like that) but I know no one would just plainly give it out so what I am asking is to at least try guiding me on this like an algorithm or something (steps, highlights, slight explanation, anything) ... coz I am unsure on how to do it(more like even start it) . Here is the question.
Write a program that simulates a questionnair to find a roommate. You will ask the user various questions that might determine a suitable match, such as their age, gender, smoking prefernce, sleeping habits, pets, etc. Use an overoloaded function, called match, to determine if their preferences match your own. The match functions will take a string, Boolean, floating-point, or integer parameter depending on the question and return a Boolean value. The questions themselves will be contained in a function which returns a Boolean value indication whether the roommate is a match (depending on an acceptable number of matches on the questionnaire)
You should make a function that given some parameters of you and of the other possible mate (who had given the answers by input) finds out if you are compatible
eg:
1 2 3 4 5 6 7 8 9 10 11
//First arguments are for the user, last arguments are your preferences
bool IsAGoodMate ( unsignedshort age, bool smoker, /*etc*/, unsignedshort YourAge, bool YouSmoke, /*etc*/ )
{
unsigned matches = 0;
if ( ages_are_similar )
matches++;
if ( both_are_smokers_or_both_arent )
matches++;
//etc
return matches > a_value_you_think_would_be_good
}
This assignment could be solved using a class having as members the answers