Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ NEEDS HELP =============================================================== movies_db.txt(This is a small part of this text file, but you can test output from the content below, you don't need

C++ NEEDS HELP

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

===============================================================

movies_db.txt(This is a small part of this text file, but you can test output from the content below, you don't need to be completely follow the sample input shown above.)

# moveID "Title" year "Genres" ImdbID Rating #Raters

102125 "Iron Man 3" 2013 "Action|Sci-Fi|Thriller|IMAX" 1300854 3.5625 32

193587 "Bungo Stray Dogs: Dead Apple" 2018 "Action|Animation" 8391976 3.5 1

193583 "No Game No Life: Zero" 2017 "Animation|Comedy|Fantasy" 5914996 3.5 1

193581 "Black Butler: Book of the Atlantic" 2017 "Action|Animation|Comedy|Fantasy" 5476944 4 1

193579 "Jon Stewart Has Left the Building" 2015 "Documentary" 5342766 3.5 1

193573 "Love Live! The School Idol Movie" 2015 "Animation" 3837248 4 1

174053 "Black Mirror: White Christmas" 2014 "Drama|Horror|Mystery|Sci-Fi|Thriller" 3973198 4.75 4

112515 "Babadook, The" 2014 "Drama|Horror|Thriller" 2321549 4.5 3

130052 "Clown" 2014 "Drama|Horror" 1780798 3.5 1

193571 "Silver Spoon" 2014 "Comedy|Drama" 3110014 4 1

190215 "Liquid Truth" 2017 "Drama" 7293380 1.5 1

190207 "Tilt" 2011 "Drama|Romance" 1680019 1.5 1

190183 "The Darkest Minds" 2018 "Sci-Fi|Thriller" 4073790 3.5 1

174053 "Black Mirror: White Christmas" 2014 "Drama|Horror|Mystery|Sci-Fi|Thriller" 3973198 4.75 4

130052 "Clown" 2014 "Drama|Horror" 1780798 3.5 1

102007 "Invincible Iron Man, The" 2007 "Animation" 903135 3 1

189547 "Iron Soldier" 2010 "Action|Sci-Fi" 1665744 1 1

189333 "Mission: Impossible - Fallout" 2018 "Action|Adventure|Thriller" 4912910 3.75 2

77561 "Iron Man 2" 2010 "Action|Adventure|Sci-Fi|Thriller|IMAX" 1228705 3.51064 47

188797 "Tag" 2018 "Comedy" 2854926 4 1

188675 "Dogman" 2018 "Crime|Drama" 6768578 3.5 1

1 "Toy Story" 1995 "Adventure|Animation|Children|Comedy|Fantasy" 114709 3.92093 215

167296 "Iron Man" 1931 "Drama" 22002 0.5 1

142056 "Iron Man & Hulk: Heroes United" 2013 "Action|Adventure|Animation" 3221698 3 1

59315 "Iron Man" 2008 "Action|Adventure|Sci-Fi" 371746 3.82447 94

2035 "Blackbeard's Ghost" 1968 "Children|Comedy" 62737 3.66667 3

112326 "Nick Fury: Agent of S.H.I.E.L.D." 1998 "Action|Sci-Fi" 119781 1 1

8462 "Executive Suite" 1954 "Drama" 46963 3 1

170813 "Baywatch" 2017 "Action|Comedy" 1469304 3 3

Background In this homework you will be developing a simple program to process movie entries stored in a text file. Your program should enable the user to search the database and print relevant movie information. See sample outputs for commands and options. Data file format The suppliedmovies_db.txt has a space-separated data in the following columnar format: moveID "Title" year "Genres" lmdbID Rating #Raters 0 Datatype Description Unique ID for a movie int titie td::string A double ed title for the movie 3 Year The vear when the movie was released td::9tring A double 4 genres 6 rating numRaters ed list of genres for the movie int The IMDB identifier for the movies An average movie rating (assigned by many reviewers Number of reviewers who contributed to rating Note: The first line of the file is a comment-line. Read and i processing entries from this gnore this line prior to Starter Code: For this homework no starter code is supplied (as it is relatively a straightforward homework, an almost identical version of a pervious exercise). Instead try to use example code snippets from labs and lectures. However, a input database text file is supplied. You need to copy the file(s) to your NetBeans project folder for testing. Homework Exercise The program for this homework absolutely must be organized into the following 3 classes Description The header file to define a class called Movie with suitable instance variables to encapsulate the 7 fields for each Movie as listed in Data file format. This file must have [7 points] File name Movie.h 3. Stream-insertion operator 4. Stream-extraction operator 5. Ato string method The source file that implements the methods associated with the Movie class Movie.cpp homework3.cpp This class must contain all the necessary logic associated with loading, finding, searching movies as discussed below. This file must use an std: :unordered_map to manage movie entries Functionality The program for this homework must have the following functionality: 1. The program should load data from a fixed "./movies_db.txt" (exactly that path) file into an unordered_map. [4 points 2. The program should repeatedly obtain commands from the user (via std: :cin) and perform the following operations 3 points] Cmd ind Kid> Example ind 1 tion Part of base case: Prints information about the movie with given id. If id was not found it prints a suitable message (see sample outputs) 4 points search "Iron Man" Prints all movies with the given search term n(i.e., sub-string) if it occurs anywhere in the term search roMyscery Soi-r(ie, "Horror ster movie entry. The program should also print the count of matching movies. [7 points Part of base case: The program should stop exit exit ating. [2 points Note: You may assume the commands entered by the user will be in correct format. Hence, reading commands is simple using std::quoted and std::cin >> x, style of input. Do not overcomplicate command processing. Sample outputs User inputs are shown in bold Enter command : find 223322 Move with ID 223322 not found in database. Enter a command: search "Iron Man" 9315 "iron Man" 2008 "Action Adventure Sci-Fi" 371746 3.82447 94 167296 "iron Man" 1931 "Drama" 22002 0.51 142056 "Action Adventure |Animation" 3221698 3 1 102125 "Ir n Man 3" 2013 "Action Sci-Fi i Thr11.er i IMAX', 1300854 3.5625 32 77561 "Iron Man 2" 2010 "Action Adventure Sci-F1 Thri1ier IMAX" 1228705 .51064 47 102007 "invincibie iron Man, The" 2007 "Animation" 903135 3 1 Found matche (s). Enter a command: search "2014 "Drama | Horror" 174053 "Black Mirror: White Christmas" 2014 "Drama Horror Mystery Sci- Fi Thriller" 397319 4.75 4 112515 "Babadook, The" 2014 "Drama Horror Thrilier" 2321549 4.5 3 130052 "ciown" 2014 "Drama Horror" 1780798 3.5 1 Found 3 matche (s) Enter a command: find 1 1 "Toy Story" 1995 "Adventure Animation Children |Comedy Fantasy 114709 3.92093 215 Enter a command: exit Iron Man Huik: Heroes United" 2013 Background In this homework you will be developing a simple program to process movie entries stored in a text file. Your program should enable the user to search the database and print relevant movie information. See sample outputs for commands and options. Data file format The suppliedmovies_db.txt has a space-separated data in the following columnar format: moveID "Title" year "Genres" lmdbID Rating #Raters 0 Datatype Description Unique ID for a movie int titie td::string A double ed title for the movie 3 Year The vear when the movie was released td::9tring A double 4 genres 6 rating numRaters ed list of genres for the movie int The IMDB identifier for the movies An average movie rating (assigned by many reviewers Number of reviewers who contributed to rating Note: The first line of the file is a comment-line. Read and i processing entries from this gnore this line prior to Starter Code: For this homework no starter code is supplied (as it is relatively a straightforward homework, an almost identical version of a pervious exercise). Instead try to use example code snippets from labs and lectures. However, a input database text file is supplied. You need to copy the file(s) to your NetBeans project folder for testing. Homework Exercise The program for this homework absolutely must be organized into the following 3 classes Description The header file to define a class called Movie with suitable instance variables to encapsulate the 7 fields for each Movie as listed in Data file format. This file must have [7 points] File name Movie.h 3. Stream-insertion operator 4. Stream-extraction operator 5. Ato string method The source file that implements the methods associated with the Movie class Movie.cpp homework3.cpp This class must contain all the necessary logic associated with loading, finding, searching movies as discussed below. This file must use an std: :unordered_map to manage movie entries Functionality The program for this homework must have the following functionality: 1. The program should load data from a fixed "./movies_db.txt" (exactly that path) file into an unordered_map. [4 points 2. The program should repeatedly obtain commands from the user (via std: :cin) and perform the following operations 3 points] Cmd ind Kid> Example ind 1 tion Part of base case: Prints information about the movie with given id. If id was not found it prints a suitable message (see sample outputs) 4 points search "Iron Man" Prints all movies with the given search term n(i.e., sub-string) if it occurs anywhere in the term search roMyscery Soi-r(ie, "Horror ster movie entry. The program should also print the count of matching movies. [7 points Part of base case: The program should stop exit exit ating. [2 points Note: You may assume the commands entered by the user will be in correct format. Hence, reading commands is simple using std::quoted and std::cin >> x, style of input. Do not overcomplicate command processing. Sample outputs User inputs are shown in bold Enter command : find 223322 Move with ID 223322 not found in database. Enter a command: search "Iron Man" 9315 "iron Man" 2008 "Action Adventure Sci-Fi" 371746 3.82447 94 167296 "iron Man" 1931 "Drama" 22002 0.51 142056 "Action Adventure |Animation" 3221698 3 1 102125 "Ir n Man 3" 2013 "Action Sci-Fi i Thr11.er i IMAX', 1300854 3.5625 32 77561 "Iron Man 2" 2010 "Action Adventure Sci-F1 Thri1ier IMAX" 1228705 .51064 47 102007 "invincibie iron Man, The" 2007 "Animation" 903135 3 1 Found matche (s). Enter a command: search "2014 "Drama | Horror" 174053 "Black Mirror: White Christmas" 2014 "Drama Horror Mystery Sci- Fi Thriller" 397319 4.75 4 112515 "Babadook, The" 2014 "Drama Horror Thrilier" 2321549 4.5 3 130052 "ciown" 2014 "Drama Horror" 1780798 3.5 1 Found 3 matche (s) Enter a command: find 1 1 "Toy Story" 1995 "Adventure Animation Children |Comedy Fantasy 114709 3.92093 215 Enter a command: exit Iron Man Huik: Heroes United" 2013

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

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions

Question

What is cultural tourism and why is it growing?

Answered: 1 week ago

Question

Does it avoid use of underlining?

Answered: 1 week ago