#include<iostream>
using namespace std;
class Person{
private:
string first_name, last_name;
public:
Person(){
first_name = "Robert";
last_name = "Brown ";
}
void display(){
cout<<"First Name: "<<first_name<<endl;
cout<<"Last Name: "<<last_name<<endl;
}
};
class Movie{
private:
string title;
int yearOfProduction;
Person director;
public:
Movie(){
title = "Spartacus";
yearOfProduction = 2021;
}
void output(){
director.display();
cout<<"Title: "<<title<<endl;
cout<<"Year of production: "<<yearOfProduction<<endl;
}
};
int main(){
Movie m;
m.output();
}
Comments
Leave a comment