Question: c++ program please Exercise - Movie Data Write a program that uses a structure named MovieData to store the following information about a movie: Title

c++ program please

Exercise - Movie Data

Write a program that uses a structure named MovieData to store the following information about a movie:

Title

Director

Year Released

Running Time (in minutes)

The program should create two MovieData variables, store values in their members, and pass each one, in turn, to a function that displays the information about the movie in a clearly formatted manner. Use the following function prototype:

void printMovieData(const MovieData &m);

Use two different methods for storing the values in the two MovieData variables. For the first MovieData variable, the values will be hard coded from an initialization list. For the second MovieData variable, the values will come as input from the user.

Your program will next create an array of 12 MovieData items. It will store the movie information from the two movie variables you just created as well as the movie information provided in the movies.txt file (contains movie information for 10 movies). Your program should open the movies.txt file and read in all of the movie information and store it in the array. Use the printMovieData function you wrote to output all of the movie information stored in the array.

Input: The program should take in the four pieces of data as input from the user in the following form: (User input is underlined and bolded)

Enter Title: The Godfather

Enter Director: Francis Ford Coppola

Enter Year Released: 1972

Enter Running Time(in minutes): 178

Output: The program should output the data in structure in the following form:

Title: Apollo 13

Director: Ron Howard

Year Released: 1995

Running Time: 140 minutes

Output:

c++ program please Exercise - Movie Data Write a program that usesa structure named MovieData to store the following information about a movie:Title Director Year Released Running Time (in minutes) The program should create

movies.txt file:

two MovieData variables, store values in their members, and pass each one,

movies.tet movies.txt The Godfather ENTER Francis Ford Coppola ENTER 1972 ENTER 178 Enter Title: Enter Director: Enter Year Released: Enter Running Time (in minutes): In Title: Apollo 13 Director: Ron Howard in Year released: 1995 Running Time: 140 in Title: The Godfather in Director: Francis Ford Coppola in Year released: 1972 Running Time: 178 Title: Jaws in Director: Steven Spielbergin Year released: 1975 Running Time: 124 In Title: The Great Escapen Director: John Sturgesin Year released: 1963 Running Time: 172 Title: Star Wars In Director: George Lucas In Year released: 1977 Running Time: 121 Title: Deadpool in Director: Tim Miller Year released: 2016 Running Time: 108 Title: Big Hero 6in Director: Chris Williams Year released: 2014 Running Time: 102 Title: Toy Story in Director: John Lasseter Year released: 1995 Running Time: 81 In Title: Pulp Fiction in Director: Quentin Tarantino In Year released: 1994| Running Time: 154 in Title: Snatchin Director: Guy Ritchien Year released: 2000 Running Time: 103 Title: Gladiatorin Director: Ridley Scottn Year released: 2000 Running Time: 155 Title: Inception in Director: Christopher Nolann Year released: 2010 Running Time: 148 Jaws Steven Spielberg 1975 124 The Great Escape John Sturges 1963 172 Star Wars George Lucas 1977 121 Deadpool Tim Miller 2016 108 Big Hero 6 Chris Williams 2014 102 Toy Story John Lasseter 1995 81 Pulp Fiction Quentin Tarantino 1994 154 Snatch Guy Ritchie 2000 103 Gladiator Ridley Scott 2000 155 Inception Christopher Nolan 2010 148

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!