• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
projectsgeek

ProjectsGeek

Download Mini projects with Source Code, Java projects with Source Codes

  • Home
  • Java Projects
  • C++ Projects
  • VB Projects
  • PHP projects
  • .Net Projects
  • NodeJs Projects
  • Android Projects
    • Project Ideas
      • Final Year Project Ideas
      • JSP Projects
  • Assignment Codes
    • Fundamentals of Programming Language
    • Software Design Laboratory
    • Data Structure and Files Lab
    • Computer Graphics Lab
    • Object Oriented Programming Lab
    • Assembly Codes
  • School Projects
  • Forum

Student Database in C Language

April 6, 2011 by ProjectsGeek 4 Comments

Student Database in C Language 

Accept student information (e.g. Roll No, Name, Percentage etc.).

  • Display the data in descending order of Percentage (Bubble Sort).
  • Display data for Roll No specified by user (Linear Search).
  • Display the number of passes and comparisons for different test cases (Worst,
  • Average, Best case).

Student Database in C Language  Code

 #include  
 #include  
 #include  
 #include  
 class A  
 {  
   protected:  
   char blood[4],name[20];  
   int date,month,year;  
   public:  
   void inputa()  
   {  
     cout<<"ENTER NAME";  
     gets(name);  
     cout<<"ENTER DATE OF BIRTH";  
     cin>>date>>month>>year;  
     cout<<"ENTER BLODD GROUP!!";  
     gets(blood);  
   }  
   virtual void display()  
   {  
     cout<<"\nNAME:"<<name; <br="">     cout<<"\nDATE OF BIRTH:"<<date<<" "<<month<<"="" "<<year;="" <br="">     cout<<"\nBLOOD GROUP:"<<blood; <br="">     getch();  
   }  
 };  
 class B:virtual public A  
 {  
   protected:  
   int height;  
   int weight;  
   public:  
   void inputb()  
   {  
     cout<<"ENTER HEIGHT";  
     cin>>height;  
     cout<<"ENTER weight";  
     cin>>weight;  
   }  
   virtual void display()  
   {  
     cout<<"\nheight :"<<height; <br="">     cout<<"\nweight:"<<weight; <br="">     getch();  
   }  
 };  
 class C:virtual public A  
 {  
   protected:  
   int hno ;  
   char city[10];  
   unsigned long int insno;  
   public:  
   void inputc()  
   {  
     cout<<"ENTER ADDRESS OF CARD HOLDER";  
     cout<<"HOUSE NO";  
     cin>>hno;  
     cout<<"CITY";  
     cin>>city;  
     cout<<"ENTER INSURANCE NO";  
     cin>>insno;  
   }  
   virtual void display()  
   {  
     cout<<"\nADDRESS OF CARD HOLDER:"<<hno<<" "<<city;="" <br="">     cout<<"\nINSURANCE NO OF CARD HOLDER:"<<insno; <br="">     getch();  
   }  
 };  
 class D:public B,public C  
 {  
   int licno;  
   unsigned long int teleno;  
   public:  
   int id;  
   D()  
   {  
     id=0;  
     strcpy(name,'\0');  
     date=0;  
     month=0;  
     year=0;  
     height=0 ;  
     weight=0;  
     strcpy(blood,'\0');  
     hno=0;  
     strcpy(city,'\0');  
     insno=0;  
     teleno=0;  
     licno=0;  
   }  
   D(D &  d)  
   {  
     id=d.id;  
     strcpy(name,d.name);  
     date=d.date;  
     month=d.month;  
     year=d.year;  
     height=d.height;  
     weight=d.weight;  
     strcpy(blood,d.blood);  
     hno=d.hno;  
     strcpy(city,d.city);  
     insno=d.insno;  
     teleno=d.teleno;  
     licno=d.licno;  
   }  
   void inputd()  
   {  
     cout<<"ENTER TELEPHONE NO AFTER FIRST DIGIT ";  
     cin>>teleno;  
     cout<<"ENTER LICENCE NO";  
     cin>>licno;  
   }  
   void display()  
   {  
     clrscr();  
     cout<<"\nID NO"<<id; <br="">     cout<<"\nNAME:"<<name; <br="">     cout<<"\nDATE OF BIRTH:"<<date<<" "<<month<<"="" "<<year;="" <br="">     cout<<"\nHEIGHT:"<<height; <br="">     cout<<"\nWEIGHT:"<<weight; <br="">     cout<<"\ncBLOOD GROUP"<<blood; <br="">     cout<<"\nADDRESS:"<<hno<<" "<<city;="" <br="">     cout<<"\nINSURANCE NO:"<<insno; <br="">     cout<<"\nPHONE NO:"<<"9"<<teleno; <br="">     cout<<"\nLICENCE NO:"<<licno; <br="">     getch();  
   }  
 };  
 void main()  
 {  
   D d[20];  
   int ch=0,i=0,j;  
   do  
   {  
     clrscr();  
     cout<<"\t\t\t\t1.BUILD A MASTER TABLE\n" ;  
     cout<<"\t\t\t\t2.DISPLAY THE ENTRIES\n" ;  
     cout<<"\t\t\t\t3.INSERT A NEW DATA\n";  
     cout<<"\t\t\t\t4.DELETE A DATA\n" ;  
     cout<<"\t\t\t\t5.SEARCH FOR SPECIFIC ENTRY\n";  
     cout<<"\t\t\t\t6.EXIT\n" ;  
     cout<<"\t\t\t\tENTER UR CHOICE";  
     cin>>ch;  
     switch(ch)  
     {  
       case 1:  
         cout<<"\n\t\tBUILD A RECORD FOR CREDIT CARD!!";  
         i=0;  
         do  
         {  
           d[i].id=i+1;  
           d[i].inputa();  
           d[i].inputb();  
           d[i].inputc();  
           d[i].inputd();  
       i++;  
           cout<<"WANT TO ENTER MORE DATA";  
         }while(getche()=='y');  
         break;  
       case 2:  
         cout<<"\n\t\tDISPLAY CREDIT CARD RECORD!!";  
         for(j=0;j<i;j++) <br="">         {  
           d[j].display();  
         }  
         break;  
       case 3:  
         cout<<"\n\t\tINSERT A NEW RECORD IN CREDIT CARD ENTRY!!";  
         int k=i;  
         for(j=0;j<i;j++) <br="">           if(d[j].id!=j+1)  
           {  
             k=j;  
             while(j<i) <br="">               d[j+1]=d[j++];  
             break;  
           }  
         d[k].id=k+1;  
         d[k].inputa();  
         d[k].inputb();  
         d[k].inputc();  
         d[k].inputd();  
         i++;  
         break;  
       case 4:  
         cout<<"\n\t\tDELETE A CREDIT CARD RECORD \n\t\tENTER ID";  
         cin>>k;  
         for(j=0;j<i;j++) <br="">           if(d[j].id==k)  
           {  
             while(j<(i-1))  
              {  
               d[j]=d[j+1];  
               break;  
              }  
           }  
           i--;  
         break;  
       case 5:  
         cout<<"\n\t\tSEARCH FOR SPECIFIC ENTRY\n\t\tENTER ID";  
         cin>>k;  
         for(j=0;j<i;j++) <br="">           if(d[j].id==k)  
             break;  
         if(j!=i)  
         {  
             d[j].display();  
         }  
         else  
           cout<<"SORRY RECORD NOT FOUND";  
         getch();  
         break;  
       case 6:  
         break;  
     }  
   }while(ch!=6);  
   getch();  
 }

 

Other Projects to Try:

  1. Matrix Operations in C Language
  2. Friend Function Implementation using C++
  3. Operator Overloading on String Functions C++ Language
  4. Simple Student Database using C Language
  5. Student Database using Virtual functions in C++

Filed Under: C Assignments, Computer Graphics Tagged With: Computer Graphics

Reader Interactions

Comments

  1. santosh says

    February 5, 2016 at 3:41 am

    THANK YOU FOR GIVE ME A CODING
    THANKS……….

    Reply
    • ProjectsGeek says

      February 7, 2016 at 8:26 am

      Thanks

  2. Sushil says

    January 18, 2012 at 8:30 am

    Thank you

    Reply
  3. DEEPAK says

    April 14, 2011 at 3:50 pm

    Thanks you !!

    nice all functions working …..

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Tags

.Net Projects Download Android Project Ideas Android Projects Angular 2 Assembly Codes C # Projects C & C++ Projects C++ Projects Class Diagrams Computer Graphics Database Project Data Mining Projects DataScience Projects Datastructure Assignments Download Visual Basic Projects Electronics project Hadoop Projects Installation Guides Internet of Things Project IOS Projects Java Java Interview Questions Java Projects JavaScript JavaScript Projects java tutorial JSON JSP Projects Mechanical Projects Mongodb Networking Projects Node JS Projects OS Problems php Projects Placement Papers Project Ideas Python Projects seminar and presentation Struts

Search this Website


Footer

Download Java Project
Download Visual Basic Projects
Download .Net Projects
Download VB Projects
Download C++ Projects
Download NodeJs Projects
Download School Projects
Download School Projects
Ask Questions - Forum
Latest Projects Ideas
Assembly Codes
Datastructure Assignments
Computer Graphics Lab
Operating system Lab
australia-and-India-flag
  • Home
  • About me
  • Contact Form
  • Submit Your Work
  • Site Map
  • Privacy Policy