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

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;

    }

Posted Date: 10/19/2012 5:32:00 AM | Location : United States







Related Discussions:- Program is to define a class as student, Assignment Help, Ask Question on Program is to define a class as student, Get Answer, Expert's Help, Program is to define a class as student Discussions

Write discussion on Program is to define a class as student
Your posts are moderated
Related Questions

Project Overview A certain financial institution (bank) wishes to promote its new business products/services by conducting road shows in rural areas. Their aim is to encourage peop


A string is said to be "Beautiful"€, if it contains only non repetitive alphabets

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

My file pointer is going to the location which i specified and writing the value but it is in next line so,please help me iam developing in visual studio6

Within software languages we have the ability to store information in mail boxes i.e. memory slots which are given names to represent the box. The naming rules are governed by the

(a) Verify the values of the resistors with the following colour coding: (i) red-red-orange-silver (ii) orange-orange-black-blue-green (b) What is the value of a resistor

how to make a diamond from steric

Write a program which incorporates a function named compute and which is used to calculate the area and circumference of a circle. Use the main function for inputs and outputs.