Click here to Skip to main content
15,845,785 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
1. Implement the Analyzer class so that its solver method returns an array of up to the top three movie titles that have been set as the favorite ones by friends of a given user. You can assume that the function input structures are properly populated.
2. If the solver method doesn't return top three movies, it should return the best N number of movies up to 3, otherwise, it should return an empty list.
3. Movies of the same count should be ordered alphabetically.


Data structures
Each Movie object consists of:
•	title (std::string). Unique, for the purposes of this task treat it as index.
•	duration (std::string).
•	actors (std::vector of std::string).
•	watchlist (std::vector of int) - list of User ID's for users who have this movie on the watchlist.
•	favorites (std::vector of int) - list of User ID's for users who have this movie in the favorites list.
•	ratings (std::vector of Rating).
Each Rating object consists of:
•	userId (int) - User ID of the corresponding user.
•	rating (int) - Integer rating (0-10) the user gave the Movie.
Each User object consists of:
•	userId (int)
•	email (std::string)
•	friends (std::vector of int) - User ID's of this user's friends.


Example output
Your implementation should return the following output for userId=62289:
["The Dark Knight", "The Godfather", "Pulp Fiction"]"


What I have tried:

Unable yet. Need help with the full program.
Posted
Updated 11-May-20 17:12pm
Comments
Richard MacCutchan 12-May-20 4:05am    
You need to be more specific about the help you are asking for. But do not expect someone to write this for you.

1 solution

Try starting with small pieces. For example, the data structure has been defined for you so write code to deal with it. Those would be methods of the structure to read it, write it, display it, and what ever else comes up. Defining that structure in a header file would be a good start.

You should be able to do ALL of this stuff yourself.

We are here to help answer questions for you. We are not here to write code for you.
 
Share this answer
 
Comments
CPallini 12-May-20 3:24am    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900