Program of A class Play

#include<iostream.h>
#include<conio.h>
#include<stdio.h>

class play
{ private:
  int playcode;
  char title[20];
  float duration;
  int ne;
  public:
  void newplay();
  void moreinfo(int,float);
  void showplay();
};
void play::newplay()
{cout<<"enter the play code";
 cin>>playcode;
 cout<<"enter the title";
 gets(title);
}
void play::moreinfo(int e,float d)
{ne=e;
duration=d;
 }
void play::showplay()
{cout<<playcode<<ne<<duration;
puts(title);
}
void main()
{clrscr();
play p1;
p1.newplay();
p1.moreinfo(10,5.5);
p1.showplay();
getch();
}

Comments

Popular Posts