Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN C++ Please with a few of the movies with their ratings. The program starts by inputting the names of the two input files (movies
IN C++ Please with a few of the movies with their ratings.
The program starts by inputting the names of the two input files (movies first). Two sample input files are provided on the course web page for testing purposes. Open "Projects", then project09-inputfiles" movies.txt" reviews.txt" When downloading, it's best to click the "Download" button in the upper-right corner The format of the movies file is simply one movie per line; assume the file contains at least 1 movie, and at most 500 movies. Example: Pulp Fiction (1994) The Shawshank Redemption (1994) The Godfather (1972) The first movie in the file is considered movie #1, the second movie in the file is considered movie #2, and so on. Since the movie names contain spaces, recall from lab that we must use the C++ getline) function to return the entire line string moviename; getline(file, moviename); Do not use getline in other situations continue to input integers, doubles, and words as before with the >> operator. Only use getline) when you need to input the entire line as a single string. Also recall from lab that the input file does not end in a special marker such as-1 or #, so you'll need to use the EOF marker to determine when to stop. Here's the proper input pattern: getline(file, moviename); while (!file.eof)) getline(file, moviename); Keep in mind the last input will be the empty string " when EOF is reached The reviews file contains movie reviews, one per line. Each movie review consists of 3 integers: a movie ID, a user ID (the id of the user who submitted the review), and the rating- a value in the range 1..5 CS 109 http:.^www.joehummel.netics109.html Page 2 of5Step 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