Fourteen98

Robert

Jul 28th, 2021
842
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class student
  5. {
  6.     int indexnumber,marks;
  7.     char name[30];
  8.     char course[5];
  9. public :
  10.     void getdata();
  11.     void display();
  12. };
  13. void student::getdata()
  14. {
  15.     cout<<"enter the index number";
  16.     cin>>indexnumber;
  17.     cout<<"enter the course";
  18.     cin>>course;
  19.     cout<<"enter the marks";
  20.     cin>>marks;
  21. }
  22. void student::display()
  23. {
  24.     cout<<"*******Student name********"<<endl;
  25.     cout<<"NAME:"<<name<<endl;
  26.     cout<<"INDEX NUMBER:"<<indexnumber<<endl;
  27.     cout<<"COURSE:"<<course<<endl;
  28.     cout<<"MARKS:"<<course<<endl;
  29. }
  30.  
  31.  
  32.  
  33.  
  34.  
  35. int main()
  36. {
  37.     student S1;
  38.     S1.getdata();
  39.     S1.display();
  40.     return 0;
  41. }
RAW Paste Data