#include<iostream> #include <string> using namespace std; //title //director //y
ID: 3610508 • Letter: #
Question
#include<iostream>
#include <string>
using namespace std;
//title
//director
//year released
//running time (in minutes)
struct MovieData
{
string title;
string director;
int year_released;
double running_time;
};
int main()
{
MovieData film1, film2;
cout << "Whatis the title of the first film?" << endl;
cin.ignore();
getline(cin, film1.title);
cout << "Who is the director of the film?" <<endl;
cin.ignore();
getline(cin, film1.director);
cout << "What year was the film released?" <<endl;
cin >> film1.year_released;
cout << "What is the running time of the film?"<< endl;
cin >> film1.running_time;
cout <<" Film 1: ";
cout << "Title: " << film1.title <<endl;
cout << "Director: " << film1.director <<endl;
cout << "Year Released: " << film1.year_released<< endl;
cout << "Running time: " << film1.running_time<< endl;
cout <<" What is the title of the second film?" << endl;
cin.ignore();
getline(cin, film2.title);
cout << "Who is the director of the film?" <<endl;
cin.ignore();
getline(cin, film2.director);
cout << "What year was the film released?" <<endl;
cin >> film2.year_released;
cout << "What is the running time of the film?"<< endl;
cin >> film2.running_time;
cout <<" Film 2: ";
cout << "Title: " << film2.title <<endl;
cout << "Director: " << film2.director <<endl;
cout << "Year Released: " << film2.year_released<< endl;
cout << "Running time: " << film2.running_time<< endl;
return 0;
}