Question: Language is c++ need help with classes just started working with them. I need to make Movie a member function setMovie that populates all three

Language is c++

need help with classes just started working with them.

I need to make Movie a member function setMovie that populates all three attributes

then repeat the code to allow user to enter data for 2 differenct movie by making 2 objects of movie class

the last 2 lines of main calls get movie function for te 2 different objects

please explain final compiling code

my code

#include using namespace std; class Movie { private: string title; string director; int year; public: void setTitle(string s1) { title = s1; } string getTitle() { return title; } void setMovie };

int main() { string temp; Movie obj1; obj1.setTitle("Jurassic Park"); temp = obj1.getTitle(); cout << temp << endl; return 0; }

expected output

Enter the movie title. Gone with the wind Enter the movie director. Victor Fleming Enter the movie year. 1940 Enter the movie title. Roman Holiday Enter the movie director. William Wyler Enter the movie year. 1953 Gone with the wind Victor Fleming 1940 Roman Holiday William Wyler 1953

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!