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

#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;
}

Explanation / Answer

please rate - thanks I'm not positive about my constructor, but I know yours isn't whatis wanted. You are just reading into the field. you also didn't have a function. this can also be done witharrays. then only have 1 set of code to ask the questions. But Idon't know since I don't have the assignment #include #include using namespace std; //title //director //year released //running time (in minutes) struct MovieData { string title; string director; int year_released; double running_time; }; void print(MovieData ,int ); int main() { string ttitle,tdirector; int tyear_released; double trunning_time; cout