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, 22.06.2019 08:50, najashohatee1234
Can online classes such as gradpoint track your ip location like if im taking a final and i give somebody else my account and they take the final for me will it show where they are taking the final from? and can this be countered with a vpn
Answers: 1
image
Computers and Technology, 23.06.2019 01:20, shiann2002
Me with this program in c++ ! computers represent color by combining sub-colors red, green, and blue (rgb). each sub-color's value can range from 0 to 255. thus (255, 0, 0) is bright red. (130, 0, 130) is a medium purple. (0, 0, 0) is black, (255, 255, 255) is white, and (40, 40, 40) is a dark gray. (130, 50, 130) is a faded purple, due to the (50, 50, 50) gray part. (in other word, equal amounts of red, green, blue yield gray).given values for red, green, and blue, remove the gray part. ex: if the input is 130 50 130, the output is: 80 0 80. thus, find the smallest value, and then subtract it from all three values, thus removing the gray.
Answers: 3
image
Computers and Technology, 23.06.2019 21:30, quintonps12
Which of the following includes the three primary network access technologies? dsl, cable modem, broadband lan, wan, man voip, uc, iptv tcp/ip, ftp, dhcp
Answers: 2
image
Computers and Technology, 24.06.2019 05:30, lexie2751
How do i get rid of my member ship for
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: