Professional Documents
Culture Documents
// Header files
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<stdio.h>
#include<string.h>
#include<process.h>
void file::input()
{
cout<<" ENTER ROLL.NO OF THE STUDENT :- ";
cin>>roll;
cout<<" ENTER AGE OF THE STUDENT :- ";
cin>>age;
cout<<" ENTER NAME OF THE STUDENT :- ";
gets(name);
}
void file::show()
{
cout<<" ROLL.NO. OF THE STUDENT :- "<<roll<<endl;
cout<<" AGE OF THE STUDENT :- "<<age<<endl;
cout<<" NAME OF THE STUDENT :- "<<name<<endl;
}
// Functions
void create();
void add();
void display();
void displayp();
void modify();
void delet();
fstream fil;
void main()
{ int opt;
while(1)
{ clrscr();
cout<<"\n MAIN MENU "<<endl;
cout<<" 1. Create Data File "<<endl;
cout<<" 2. Add New Record In Data File "<<endl;
cout<<" 3. Display Record From Data File "<<endl;
cout<<" 4. Display Particular Record From Data File "<<endl;
cout<<" 5. Modify Particular Record From Data File "<<endl;
cout<<" 6. Delete Particular Record From Data File "<<endl;
cout<<" 7. Exit From Program "<<endl;
cin>>opt;
switch(opt)
{ case 1: { create(); // function for creating new data
cout<<" Display Main Menu"<<endl;
getch();
break;
}
case 2: { add(); // function for adding new data
cout<<" Display Main Menu"<<endl;
getch();
break;
}
case 3: { display(); // function for displaying data
cout<<" Display Main Menu"<<endl;
getch();
break;
}
case 4: { displayp(); // function for displaying particular record
cout<<" Display Main Menu"<<endl;
getch();
break;
}
case 5: { modify(); // function for modification in file
cout<<" Display Main Menu"<<endl;
getch();
break;
}
case 6: { delet(); // function for deleting particular record
cout<<" Display Main Menu"<<endl;
getch();
break;
}
case 7: { exit(0); // exit from program
}
default:{ cout<<" Wrong choice....Press Key For View The Main Menu";
getch();
clrscr();
}
}
}
getch();
}