write a Pascal program that allows a person to manage their movie collection. In the full version of the assignment your program will read the initial information a file into an array of records. (For marking purposes your program must be able to use 'movies.dat' as an input file). The user can perform common list management functions, such as adding or removing movies. When the person has finished with the program, he or she can then save the updated information back to the data file and to reload the updated information later.
Each movie will be described by four fields with each field residing on a separate line (or lines in the case where there are sub-fields) in the following order:
The names of the first three cast members.
The genre of the movie
The number of stars (the rating of the movie)
Description of the fields
1. Movie name
The name of the movie will be up to 80 characters in length.
The cast list will consist of the full names of three of the actors from this film. Each actor's name will appear on a separate line, both in the data file and when the collection is displayed onscreen. Each actor's name acts as a sub-field for this field but you can treat each person's name as one continuous string, e.g., you don't need separate fields for the first, middle and last name. The maximum length of the name field for each actor will be 80 characters. Thus a 1D array of strings can be used to store the cast information: the number in the brackets determine which actor is being accessed while index for a particular string determines which part of an actor's name is being accessed.
The genre field describes the category that the movie falls into. There will be six different categories of movies: action, drama, science fiction, comedy, horror, martial arts or 'other'. In the input file, the genre field will consist of a series of character up to fifteen characters in length.
This field uses a number of stars to rate each movie according to how good or bad that I thought it was1. The greater the number of stars, the better the movie. In the input file the number of stars that a movie received will be specified by an integer ranging from one to five.
1 star (It sucks): It's not the type of movie that's so bad that it's good, it's just all bad. Don't
waste your time with this one.
2 stars (Poor): Overall there were more things that I disliked than liked with this movie.
Unless there's a ticket sale it's probably one that you should avoid.
3 stars (Average): There were some things that I liked and some things that I disliked. It's one
that you may want to rent rather than buy.
4 stars (Good): This movie has some flaws but overall you'll have a great time watching it.
5 stars (A true masterpiece!): OMG! I laughed, I cried, it became a part of me. It should definitely
be nominated for an Oscar (maybe several).
The four main fields for each movie will be followed by a line of stars:
TERMINATOR 2 JUDGMENT DAY
IT'S A WONDERFUL LIFE
ROMEO AND JULIET
The lines of stars are not to be read into the array of records. It is only used to visually separate the movies in the input file.
(Bare bones) basic assignment (worth 10 marks)
* Declares a new type (e.g., 'Movie') that stores the 4 attributes of each movie.
* Declares a new type (e.g., 'MovieList') that consists of an array of 100 elements with each array element consisting of a movie.
* Declares an instance of the array.
* Initializes each field of each element of the array to the following values (Name := 'NNNNNN'; Cast (all three members are set to this value) := 'CCCCCC'; Genre :='GGGGGG'; Rating := -1').
* Displays an introduction with instructions about how the program works.
* Displays a sign off exit message to indicate to the user that he or she has exited the program.
* Implements some form of debug mode (i.e., it has a debugging variable that will display some sort of debugging message when the program is in debug mode).
* The program error checks the genre field to ensure that a proper category is entered. If another genre is entered then the program will enter 'other' as the genre.
* The program error checks the rating field to ensure that a movie receives a rating from one to five stars. If another value is entered then the program will set the rating to 3.
* The most basic list management functions are implemented:
* Your program reads the information from the input file (specified by the user) into the array. The contents of that array can be displayed onscreen with write and writeln statements. Each movie will be separated onscreen by a line of tildes '~'. When the list of movies is long, to prevent the output from scrolling off the screen your program should 'pause' the display of movies ever so often (say after displaying every 4th or 5th movie) while it waits for a response from the user to tell it to continue (e.g., 'Hit enter to continue'). The output must be displayed in a neat and legible format (try running the sample executable for an example). Finally your program must be able to write the movie list back to an output file (specified by the user). The line of stars that separated each movie in the input file must be written back to the output file. For the basic version of the assignment your program does not have to be able to re-read the list from a file that it just wrote to (that is an extra feature). Similar to previous assignments, your program has menu driven interface. The basic program should display a menu similar to the one shown below:
Movie Manager: Menu options
(l)oad a collection from disk
(s)ave the collection to disk
(q)uit the program
For the base assignment these are the only menu functions that needs to actually work. You should add additional menu options as you implement the extra features that are listed below.