Answer to Question #185441 in C++ for tatheer

Question #185441

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



1
Expert's answer
2021-04-25T13:56:10-0400


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

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS