Thursday, 20 July 2017

program of class play

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
class play
{ public:
int playcode;
char title[100];
float dur;
int epi;
  void newplay()
  {
   cout<<"enter the play code\n";
   cin>>playcode;
   cout<<"enter the title\n";
   gets(title);
   }
  void moreinfo(float x,int y)
  {
  dur=x;
  epi=y;
  }
  void showplay()
  {
  cout<<"play code"<<playcode<<"\n";
  puts(title);
  cout<<"duration"<<dur<<"\n";
  cout<<"episode"<<epi<<"\n";
  }
};
void main()
{
clrscr();
int a,b;
cout<<"enter the duration\n";
cin>>a;
cout<<"enter the episode no\n";
cin>>b;
play p;
p.newplay();
p.moreinfo(a,b);
p.showplay();
getch();
}

No comments:

Post a Comment