Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ A) Design a class called MovieData to store the following information about

ID: 3808631 • Letter: C

Question

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:



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

Explanation / Answer

};

void main()

{

MovieData object; // constructor invoked and object created

object.print(); // print called

getch();

}