Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

answer in C++ Movie Vector Write a program that allows the user to enter movie information, which is then stored in a vector. The user

answer in C++

Movie Vector

Write a program that allows the user to enter movie information, which is then stored in a vector. The user should enter data for at least one movie, but the program should ask if they have additional information to enter. When the user has indicated that they are done entering movie data, the program should output the information stored in the vector

You should use:

A struct called Movie to store the following information:

Title

Director

Year Released

Running Time (in minutes)

A vector of type Movie to store the information

A function that allows you to obtain the data. The function should have a reference to a movie variable as a parameter, but does not return a value. (Tip: as in the class example the variable should receive all the data before it is inserted into the vector. Insert enough data for at least two movies for this exercise.

A function to output the movie data that was entered. This function should accept two parameters: a vector and an integer (for the size of the vector).

Tip: In case youre wondering, the header for the function that uses a

vector should have a typical vector declaration within the parentheses.

Recall: To declare a vector, include the vector template and use the general

syntax: vector name

Sample output is shown below:

Enter the title of the movie: The Dark Knight

Enter the director's name: Christopher Nolan

Enter the year the movie was created: 2008

Enter the movie length (in minutes): 152

Do you have more movie info to enter?

Enter y/Y for yes or n/N for no: y

Enter the title of the movie: The Avengers

Enter the director's name: Joss Whedon

Enter the year the movie was created: 2012

Enter the movie length (in minutes): 143

Do you have more movie info to enter?

Enter y/Y for yes or n/N for no: Y

Enter the title of the movie: Deadpool

Enter the director's name: Tim Miller

Enter the year the movie was created: 2016

Enter the movie length (in minutes): 108

Do you have more movie info to enter?

Enter y/Y for yes or n/N for no: n

Here is the info that you entered:

Movie Title: The Dark Knight

Movie Director: Christopher Nolan

Movie Year: 2008

Movie Length: 152 minutes

Movie Title: The Avengers

Movie Director: Joss Whedon

Movie Year: 2012

Movie Length: 143 minutes

Movie Title: Deadpool

Movie Director: Tim Miller

Movie Year: 2016

Movie Length: 108 minutes

____________________________________________________________________

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

How do members envision the ideal team?

Answered: 1 week ago

Question

What are the major social responsibilities of business managers ?

Answered: 1 week ago

Question

What are the skills of management ?

Answered: 1 week ago

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago