Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a function readRatings that performs a similar task on the user ratings file Each username represented in ratings.txt is followed by list of integers--ratings
Write a function readRatings that performs a similar task on the user ratings file Each username represented in ratings.txt is followed by list of integers--ratings of each book in books.txt. Rating Meaning Did not read Hell No hate it!! Don't like it. Meh neither hot nor cold Liked it! Mind Blown Loved it! 4 Your function should Accept six arguments in this order: o string: the name of the file to be read o string array: usernames o 2D int array: list of ratings for each user (first index specifies user) o int: number of users currently stored in the arrays o int: row capacity of the 2D array (convention: array[row][column]) [assume to be 100) int: column capacity of the 2D array [assume to be 50] o Use ifstream, stringstream, and getline to read and parse data from the file, placing usernames in the usernames array and book ratings in the ratings array (stoi will also be useful here) Print the username of each user as they are added to the system . . cout
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started