PROGRAM ON DEFINING A CLASS REPORT.

#include<iostream.h>
#include<conio.h>
Class REPORT
{
       int admno;
      char name[20];
      float marks, sub1,sub2,sub3,sub4,sub5;
      int average;
      void GETAVG()
      {
             marks=sub1+sub2+sub3+sub4+sub5;
             average=marks/5;
      }
      void READINFO()
      {
            cout<<”Enter the admission no.:”;
            cin>>admno;
            cout<<”Enter the name:”;
            gets(name);
            cout<<”Enter the marks:”;
            cin>>marks;
            GETAVG();
       }
       void DISPLAYINFO()
      {
            cout<<”Admission no. is:”<<admno;
          cout<<”Name is:”<<name;
          cout”Marks is:”<<marks;
       }
};
void main()
{
      clrscr();
      report r;
      r.readinfo();
      r.displayinfo();
      getch();

}

Comments

Popular Posts