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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:10, nawaphon1395
Is the following an example of social media viral marketing? indicate your response by selecting yes or no. when you sign onto your favorite social networking website, you get messages from friends who have seen a television show they thought was a "must see! "
Answers: 1
image
Computers and Technology, 22.06.2019 19:30, 710jonathan
The following is an excerpt from a slide presentation. today we will inverse operations solving equations using inverse operations solving inequalities using inverse operations from which part of the presentation does the slide most likely come from? a. introduction b. outline c. body d. conclusion
Answers: 1
image
Computers and Technology, 23.06.2019 16:30, isaiahhuettnerowgg8d
What is one reason why indoor air pollution has become an increasing problem.
Answers: 1
image
Computers and Technology, 23.06.2019 21:50, Trinhphuongtran
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
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 in other subjects:

Konu
Spanish, 22.01.2021 21:40
Konu
Mathematics, 22.01.2021 21:40
Konu
Mathematics, 22.01.2021 21:40
Konu
Mathematics, 22.01.2021 21:40