Question: Your Task Your program should behave as follo 18 points Load the 20 book names and the book ratings from 30 people into two arrays



Your Task Your program should behave as follo 18 points Load the 20 book names and the book ratings from 30 people into two arrays in memory. These can be read by your program using the scanner class. You are not required to handle FileNotFoundException 10 points Ask the user to enter a rating (between 1 and 5, or -1 if they haven't read it) for each book. 18 points Create a method that determines for each of the 30 people a score, which represents how similar that person's tastes are to the taste of the user of the program. Store these similarity scores in an array of 30 doubles. The similarity scores should be between 0 and 1 each 18 points Create an array that represents recommended ratings for the user. There should be 20 numbers in this array, one for each book. The higher the number, the more strongly your program thinks the user will like the book. The number should be the average over all 30 ratings for the book that are greater than 0 (only include ratings for users who have actually rated the book). However, it should be a weighted average: people who are more similar to the current user should have a higher weight than people who are less similar. 16 points Display the name of the top book (according to the recommended ratings from the previous step) that the user has not yet read Suggestions and hints Making a Recommendation The goal is to come up with a recommendation for a book that the user might like. If you and I have similar preferences, and there's a book that I haven't read that you like, chances are good that I might like it. Suppose there's another person, whose tastes kind of match mine, who also happens to like the book. We now have even more evidence that I might like the book (but because my tastes only kind of match the other person's, it only lends a little bit of weight to the decision) Imagine, now, that I don't just have information of a couple of friends upon which to base a recommendation. In this assignment, we'll have information from 30 people about their preferences. We put all of that information together to form a single score for each book, which can be calculated as a weighted average of all of the ratings of all the other users. We assign more weight to the ratings of people whose preferences are similar to ours, and a smaller weight for people whose preferences are dissimilar. We calculate a score for each book, and the one we recommend is the one with the highest score The mathematical formula for a weighted average, where there are N numbers stored in an array called a, and N corresponding weights stored in an array called w, goes like this: weighted-average (N, A[ ] , w[ ] ) (A[ 0 ] *W [ 0 ] + A [ 1 ] *w[ 1 ] + + A [N-1 ] *W[N-1 ] ) / (W [ 0 ] + = . . . Your Task Your program should behave as follo 18 points Load the 20 book names and the book ratings from 30 people into two arrays in memory. These can be read by your program using the scanner class. You are not required to handle FileNotFoundException 10 points Ask the user to enter a rating (between 1 and 5, or -1 if they haven't read it) for each book. 18 points Create a method that determines for each of the 30 people a score, which represents how similar that person's tastes are to the taste of the user of the program. Store these similarity scores in an array of 30 doubles. The similarity scores should be between 0 and 1 each 18 points Create an array that represents recommended ratings for the user. There should be 20 numbers in this array, one for each book. The higher the number, the more strongly your program thinks the user will like the book. The number should be the average over all 30 ratings for the book that are greater than 0 (only include ratings for users who have actually rated the book). However, it should be a weighted average: people who are more similar to the current user should have a higher weight than people who are less similar. 16 points Display the name of the top book (according to the recommended ratings from the previous step) that the user has not yet read Suggestions and hints Making a Recommendation The goal is to come up with a recommendation for a book that the user might like. If you and I have similar preferences, and there's a book that I haven't read that you like, chances are good that I might like it. Suppose there's another person, whose tastes kind of match mine, who also happens to like the book. We now have even more evidence that I might like the book (but because my tastes only kind of match the other person's, it only lends a little bit of weight to the decision) Imagine, now, that I don't just have information of a couple of friends upon which to base a recommendation. In this assignment, we'll have information from 30 people about their preferences. We put all of that information together to form a single score for each book, which can be calculated as a weighted average of all of the ratings of all the other users. We assign more weight to the ratings of people whose preferences are similar to ours, and a smaller weight for people whose preferences are dissimilar. We calculate a score for each book, and the one we recommend is the one with the highest score The mathematical formula for a weighted average, where there are N numbers stored in an array called a, and N corresponding weights stored in an array called w, goes like this: weighted-average (N, A[ ] , w[ ] ) (A[ 0 ] *W [ 0 ] + A [ 1 ] *w[ 1 ] + + A [N-1 ] *W[N-1 ] ) / (W [ 0 ] + =
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
