Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribed

image text in transcribed

image text in transcribed

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 of5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions