Create a class
entertainment
consisting of the following data members:
•Title
•Air_Date i.e. Release Date
•Genre
•Type (i.e. Movie, TV Show)
•Runtime
Country
•Actors
Rating
#include <bits/stdc++.h>
#include<iostream>
#include <stdio.h>
using namespace std;
class entertainment{
public:
string title;
int date;
string type;
string country;
int rating;
void input()
{
cout<<"Enter Title"<<endl;
cin>>title;
cout<<"Enter date of release"<<endl;
cin>>date;
cout<<"Enter Genre type"<<endl;
cin>>type;
cout<<"Enter Runtime country"<<endl;
cin>>country;
cout<<"Enter actors rating"<<endl;
cin>>rating;
}
void display()
{
cout<<"Title : "<<title<<endl;
cout<<"Air Date : "<<date<<endl;
cout<<"Genre Type : "<<type<<endl;
cout<<"Runtime Country : "<<country<<endl;
cout<<"Actors Rating : "<<rating<<endl;
}
};
int main()
{
int n;
cout<<"Enter value of n"<<endl;
cin>>n;
entertainment e[n];
for(int i=0; i<n; i++)
{
e[i].input();
cout<<endl;
}
cout<<endl<<endl;
cout<<"Display of Entertainment info"<<endl;
cout<<"----------------------------------"<<endl;
for(int i=0; i<n; i++)
{
e[i].display();
cout<<endl<<endl;
}
}
Comments
Leave a comment