Question
IN C++!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! COMPATIBLE WITH VISUAL STUDIOS Write a program that reads information about movies from a file named movies.txt. Each line of this file contains
IN C++!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! COMPATIBLE WITH VISUAL STUDIOS
Write a program that reads information about movies from a file named movies.txt. Each line of this file contains the name of a movie, the year the movie was released, and the revenue for that movie. Your program reads this file and stores the movie data into a list of movies. It then sorts the movies by title and prints the sorted list. Finally, your program asks the user to input a title and the program searches the list of movies and prints the information about that movie. To represent the movie data you have to create a struct named Movie with three members: title, yearReleased, and revenue. To handle the list of movies you have to create an array of Movie structs named topMovies capable of storing up to 20 movies. Your solution must be implemented using the following functions: storeMoviesArray(ifstream inFile, Movies topMovies[], const int SIZE) // This function receives the input file, the movies array, and the size of the // array. // It reads from the file the movie data and stores it in the array. // Once all the data has been read in, it returns the array with the information // of the movies. sortMoviesRevenue(Movies topMovies[], const int SIZE) // This function receives the movies array and the size of the array and sorts // the array by revenue. It returns the sorted array. sortMoviesTitle(Movie topMovies[], const int SIZE) // This function receives the movies array and the size of the array and sorts // the array by title. It returns the sorted array. printMoviesArray(Movie topMovies[], const int SIZE) // This function receives the movies array and the size of the array and prints // the list of movies. findMovieTitle(Movie topMovies[],const int SIZE, string title) // This function receives the movies array, the size of the array, and the title // of the movie to be searched for. // It returns the index of the array where the title was found. If the title was // not found, it returns -1. main() // Must call the functions. IMPORTANT: You must define whether the function is a void or a value-returning function. You must define whether a parameter is a value parameter or a reference parameter. You must use the identifiers I provide you for the parameters and functions. Assume the input file will always have exactly 20 movies
This the text file it should read
HarryPotterAndTheDeathlyHallowsPartI 2010 283533215
Inception 2010 292568851
Avatar 2010 408392727
AliceInWonderland 2010 334191110
TheTwilightSagaEclipse 2010 300531751
HowToTrainYourDragon 2010 217581231
DespicableMe 2010 251203225
ShrekForeverAfter 2010 238736787
ToyStory3 2010 415004880
IronMan2 2010 312433331
StarWars:TheForceAwakens 2015 2068223624
JurassicWorld 2015 1670400637
Furious7 2015 1516045911
Avengers:AgeofUltron 2015 1405413868
Minions 2015 1159398397
Spectre 2015 880674609
InsideOut 2015 857611174
Mission:ImpossibleRogueNation 2015 682330139
TheHungerGames:Mockingjay 2015 653428261
TheMartian 2015 630161890
Must produce this output:
AliceInWonderland 2010 $334191110 Avatar 2010 $408392727 Avengers:AgeofUltron 2015 $1405413868 DespicableMe 2010 $251203225 Furious7 2015 $1516045911 HarryPotterAndTheDeathlyHallowsPartI 2010 $283533215 HowToTrainYourDragon 2010 $217581231 Inception 2010 $292568851 InsideOut 2015 $857611174 IronMan2 2010 $312433331 JurassicWorld 2015 $1670400637 Minions 2015 $1159398397 Mission:ImpossibleRogueNation 2015 $682330139 ShrekForeverAfter 2010 $238736787 Spectre 2015 $880674609 StarWars:TheForceAwakens 2015 $2068223624 TheHungerGames:Mockingjay 2015 $653428261 TheMartian 2015 $630161890 TheTwilightSagaEclipse 2010 $300531751 ToyStory3 2010 $415004880
Enter a movie title: ToyStory3
Title: ToyStory3 Year Released: 2010 Revenue: $415004880
Do you want to continue? (y/n):
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started