Program is to define a class as student, C/C++ Programming

Assignment Help:

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;

    }


Related Discussions:- Program is to define a class as student

Creates and implements a class to represent the queue, Purpose This ass...

Purpose This assignment is an exercise in implementing the queue ADT using a singly-linked list. This assignment also introduces the concept of templates. Assignment Th

Areaundercurve, Write a program to find the area under the curve y = f(x) b...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve betw .

Define the increment and decrement operators in c language, Define the Incr...

Define the Increment and Decrement Operators in c language? C offers two special operators -and ++ called decrement and increment operators respectively and these are unary ope

What are the benefits of using friend classes, What are the benefits of usi...

What are the benefits of using friend classes? - Friend classes are useful when a class wants to hide features from users which are required only by another, tightly coupled cl

Inside and outside type casting, depth description of the inside and outsid...

depth description of the inside and outside typecasting

Explain static variables, Static Variables Static variables have the si...

Static Variables Static variables have the similar scope s automatic variables, but, unlike automatic variables, static variables retain their values over number of function ca

Function, #q•Design and code a new function that accepts as parameters the ...

#q•Design and code a new function that accepts as parameters the gross pay by value and the federal tax, state tax, local tax, SS tax, and net Pay by reference. Calculate the taxes

Area under curve, Write a program to find the area under the curve y = f(x)...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. #include float start_point,

Describe the behaviour of procedure, Observe that our model of evaluation a...

Observe that our model of evaluation allows for combinations whose operators are compound expressions. (a) Use this observation to describe the behavior of the following procedu

Constructor and destructor function with derived classes, Constructor and D...

Constructor and Destructor function with derived classes If there are constructors included in the base class and the derived class, the compiler automatically calls both of th

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd