program is to define a class as studentprogram is


Program is to define a class as student:

Program is to define a class as student and display the records specific depending upon the number

class student

 {

 private:

   int roll,i;

   char name[20],grade;

   float per;

   int marks[5],total;

  int calculate()

     {

     per=total/5;

     return per;

     }

  public:

    student()// constructor assigning initial values

     {

     total=0;

     }

    void input();

    void disp();

   // void disp_spe();

  };

 

 void student::input()

   {

   cout<<" enter your name "<

   gets(name);

   cout<<" enter your roll no. "<

   cin>>roll;

   cout<<" enter the marks of five subjects "<

   for (i=0;i<=4;i++)

     {

     cin>>marks[i];

     total=total+marks[i];

     }

   }

  void student::disp()

     {

     clrscr();

    cout<<" R E P O R T   C A R D "<<"\n\n";

    cout<<" The name is : "<

    cout<<" The marks of all subjects is :"<<"\n";

     for (i=0;i<=4;i++)

       {

      cout<

       }

    calculate();

    cout<<" The percentage is :"<

     if(per>=85)

                cout<<" The grade is : A";

     else if(per>40)

                cout<<" the grade is : D";

     else

                cout<<" The grade is : B";

      }

 

  void student::disp_spe()

     {

     int rollno;

     cout<<" enter the  students roll no. you want report card "

     cin>>rollno;

     if(

 

  void main()

    {

    clrscr();

   student *data;

   data=new student;

   data->input();

   data->disp();

   data->disp_spe();

   delete data;

    }

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: program is to define a class as studentprogram is
Reference No:- TGS0174904

Expected delivery within 24 Hours