subject

I need to create a movie database program in C++ the program needs to do the following:
1. Populate your dynamically-allocated array of Movie objects by reading in information from the file
2. Ask the user to enter a movie title and perform a noncase-sensitive search a. If the movie is found, display the movie’s information and ask the user if they would like to save the movie; if they choose yes, save the movie to favorites. txt b. If the movie is not found, display an error message
3. Ask the user if they would like to exit a. If they choose not to exit, prompt them for a new movie title and repeat the process b. If they want to exit, display all movies in favorites. txt
And the program needs to contain the following functions
1. int numberOfLines(ifstream&);
This function accepts an input file and returns an integer representing the number of lines in the file
2. void populateMovieFromFile(ifstream& , Movie&);
This function accepts an input file and a Movie object. Inside the function, a single line should be read in from the current read position of the input file. Once the line has been read in, it will be parsed and stored in the Movie object that was passed to the function. Notice that for a single call of populateMovieFromFile, only a single Movie object is populated. This means you will need to call it multiple times!
3. void displayMovie(const Movie&);
This function accepts a Movie object passed by constant reference and displays the contents of that object in a formatted fashion (see sample run).
4. Movie* createDatabase(int&);
As the name suggests, this function will be responsible for creating your movie database (which is just a dynamically-allocated array of Movie objects). The integer argument passed by reference to the function represents the number of movies in the database. It will not be initialized when you call the function, meaning its value will be set inside the body of the function. This function should:
First, prompt the user to enter an input file name. If the name is invalid, display an error and continue to prompt them until a valid file name has been entered.
Determine the number of lines in the file using the numberOfLines function and create your dynamically-allocated array of Movie objects.
Loop through your newly-created array and store a movie in each index. This is where you will want to call your handy populateMovieFromFile function.
Populate the reference argument and return a pointer to the array of Movie objects
5. bool caseInsensitiveCmp(string, string);
This function accepts two strings and performs a noncase-sensitive comparison on the two. If the two strings are the same, the function should return true; otherwise, it should return false. For example, if I pass the strings "skyfall" and "SKYFALL" to this function, it should return true.
6. void findMovie(Movie*, int);
This function accepts a pointer to an array of Movie objects (your database), and the number of Movies (which is the same thing as the number of elements in the array). The function should: First, prompt the user to enter a movie title to search for Search through the array of Movie objects for the movie title ○ If the movie was found, display the movie and ask the user if they would like to save the movie; if they choose yes, the movie will be saved to favorites. txt ○ If the movie was not found, display an error message Notice that this function only prompts the user for a single movie and only performs a single search. This means you will be using it in a loop!
7. void saveToFile(const Movie&);
This function accepts a Movie object, passed by constant reference. It should save the Movie object to the "favorites. txt" file. If the file does not exist, create it. If the file does exist, add the Movie object to the end of the file. Remember that you need to store the Movie object in the format: Movie title, Gross Total (in billions), Director, Release Date, Runtime (in minutes)
8. bool promptToContinue();
This function will determine whether or not the user wants to continue using the program. First, ask the user if they would like to exit the program and prompt them to either enter ‘Y’ or ‘N’. If ‘Y’ or ‘y’ is entered, the function will return false (the user no longer wishes to continue); otherwise, return true.
9. void displayFavorites();
This function will display all saved favorite movies by displaying all the information in the favorites. txt file. If there are no saved movies, display an error; otherwise, simply display all saved movies.
A complete example of a working program would be greatly appreciated.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:10
Are special combinations of keys that tell a computer to perform a command. keypads multi-keys combinations shortcuts
Answers: 1
question
Computers and Technology, 23.06.2019 12:30
Animations and transitions are added from the
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
It is not necessary to develop strategies to separate good information and bad information on the internet. true or false
Answers: 1
question
Computers and Technology, 24.06.2019 11:30
Convert 11001110(acdd notation) into decimal
Answers: 2
You know the right answer?
I need to create a movie database program in C++ the program needs to do the following:
1. Po...
Questions
question
Computers and Technology, 01.08.2019 19:30
Questions on the website: 13722363