Movie database

 

Point Breakdown

Objective

To gain experience with using an array of structures, as well as with dynamic allocation of an array. This program provides further practice in file input, strings (either c-strings or string objects, programmer’s choice), function building, if statements/switch, loops, and general code task problem solving and layout.

Filename: movies.cpp

Task

Seeing our lifestyle has changed a bit lately, you’ve suddenly found yourself to have so much time to watch those movies you have on your list. The problem? Your movie list is so long! Let’s create a movie data organizer to help us organize our movie collection. This assignment will simulate the loading, manipulation, and exporting of a movie “database” which will be a collection of movie information that comes from a .txt file.

Input File Format

The first line of the input file will be a single integer number — this value tells how many movies are in this movie database text file. There’s no guarantee how many records will be in a file that the user opens, so you must create your dynamic array of structs only AFTER reading in this first integer value.

After this first line, each line following represents one movie entry with data in the following format on each line: GENRE:MOVIE TITLE, year runtime rating
More specifically, each of the movie data lines contain: the Genre of the Movie (can be ACTION, DRAMA, SCIENCE FICTION, or COMEDY)  a colon :  the full movie title  a comma  a space  the year  a space  the runtime in minutes  a space  the rating (can be G, PG, PG-13, R)  a newline 

You may assume that any given movie files are in the correct format, and that any files we test with your program will also be of the same, above, correct format. You can also assume there there is no trailing whitespace in the file, and that the types and limits will be as described above. Finally, you can assume the file will at least contain one movie (there will be no files we use to test your program that contain zero movies)

You SHOULD test on many different files that have a different number of records in the file.
It’s best to modify this .txt file right in CLion! DO NOT ever open your input file in “notepad” (windows utility). This will cause your file to have different newline chars used, and cause issues while trying to read in the file. Make sure to test your program with a few different movie text files. If your assignment only works with one sample movie file/one size, you’ll lose 50 points.

Sample movie data input files

.

.

You can right click those links above, “save as” , and save it to your machine. Avoid opening these .txt files in “notepad” or any other editor besides the one you’re compiling with. For onlineGDB, you can “upload” these files to your current project folder.

  • Program Details
  • Your program’s overall goal is to allow the user to select menu options that will ultimately load the data in a movie file (a movie “database”) in to your program, and then work with that database. We are going to store our movie database in an ARRAY of STRUCTURES. Specifically, an array of structures of type Movie (an array of movies! ).

Start with . I’ve helped to lay some things out for you that will get you started. I’ve also declared the pointer of type Movies named movieArr, and initialized it to the Null Pointer for you. The pointer being set to 0 (null) can be used to mean that no array has been allocated yet to store a “movie database”. You’ll use this pointer anytime you need to allocate a new dynamic array to then store some movie data from a file.

Create a structure type called Movies. Each object of type Movies should contain fields for the following:

genre (a string or c-string)

  • movie title (a string or c-string)

movie rating (a string or c-string)

Release year of the movie (an integer)

Runtime of the movie (in minutes) (an integer)

Enter a menu loop that prints the following menu and allows the user to choose from the following options (they should enter the corresponding value to choose):1 – Load Movie File 2 – View Total Movie Database Runtime 3 – View Movies by Rating 4 – Export Movies by Genre 5 – Clear Currently Loaded Database 6 – Print Database Sorted by Year
Q – Quit Selection >  
Should you decide to add additional features, you’re welcome to add options to this menu. If you choose to not do option 6 (which is for extra credit), you may omit it from your menu. Note if the user enters an invalid menu option, you should handle this and allow the user to keep trying to enter valid options.

Movie database

We offer the best custom writing paper services. We have answered this question before and we can also do it for you.

GET STARTED TODAY AND GET A 20% DISCOUNT coupon code DISC20

Why Choose Us

  • 100% non-plagiarized Papers
  • 24/7 /365 Service Available
  • Affordable Prices
  • Any Paper, Urgency, and Subject
  • Will complete your papers in 6 hours
  • On-time Delivery
  • Money-back and Privacy guarantees
  • Unlimited Amendments upon request
  • Satisfaction guarantee

How it Works

  • Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
  • Fill in your paper’s requirements in the "PAPER DETAILS" section.
  • Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
  • Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
  • From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.