Question: C++ A) Design a class called MovieData to store the following information about a movie: Title (a string ) Director (a string ) Year Released

C++

A) Design a class called MovieData to store the following information about a movie:

Title (a string )

Director (a string )

Year Released (an integer )

Running time (in minutes - an integer )

Include a constructor that allows all four of these member data values to be specified at the time a MovieData variable is created (use the above order for the parameters ). The class should also provide a member function, print, that displays the information as follows: Title (Year). Directed by Director. (Running time minutes) Example: The Good, The Bad and The Ugly (1966). Directed by Sergio Leone. (161 minutes)

B) Write a program that uses the MovieData class you defined in 7.8a. The program prompts "movie information: " and then reads the title, director, release year and running-time, each typed on a line by itself (use the getline function to read in the title and director strings ). The program then creates a MovieData object and uses the object to print the movie information. Here is one sample run:

movie information: Casablanca Michael Curtiz 1942 102 Casablanca (1942). Directed by Michael Curtiz. (102 minutes) 

Note: Do not define the class here-- just write the program that uses it.

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!