Question: Define a class called DatingProfile. The initializer takes 4 arguments: name ( string ) , age ( integer ) , looking _ for ( string

Define a class called DatingProfile. The initializer takes 4 arguments: name (string), age (integer), looking_for (string) and interests (list of strings). Set instance variables for each of the arguments. repr returns a string that prints (remember, repr itself does not print) like this:
----- Jeanine -----
Age: 26
Looking for: Short term dating
Interests: Skiing, Board games, Hiking
(this is just an example)
Write an instance method called match_me_with that takes another DatingProfile object as an argument.
The match_me_with method will return one of these strings: "Not a good match", "Possible match", "Good match", and "Great match", based on how well the profiles align. Each match has an initial value of "Not a good match" and increases by one level for each similarity between the profiles based on these conditions:
If the difference in age between the 2 profiles is less than 10 years
If they are looking for the same thing
If they have at least one interest in common
For example:
If
jeanine = DatingProfile('Jeanine',26, 'Short term dating', ['Skiing', 'Board games', 'Hiking'])
bob = DatingProfile('Bob',57, 'Long term dating', ['TV', 'Stamp collecting', 'Hiking'])
Then
jeanine.match_me_with(bob)
Would return
"Possible match"
Because:
Their age difference is more than 10(57-26), so no change in their match likelihood
Jeanine is looking for Short term dating and Bob for Long term dating, so no change in their match likelihood
They both are interested in Hiking, so their match likelihood gets bumped up from "Not a good match" to "Possible match"

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!