apl-mhd

Compiler Lab

Jan 22nd, 2019
157
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <cstdio>
  3.  
  4. using namespace std;
  5.  
  6.  
  7. struct DataTable{
  8.  
  9.     char name[30];
  10.     char type[30];
  11.  
  12. };
  13.  
  14.  
  15. void insertData(){
  16. }
  17. void searchData(){
  18. }
  19. void deleteData(){
  20. }
  21. void showData(){
  22. }
  23. void updateData(){
  24. }
  25.  
  26.  
  27. void menuBar(){
  28.  
  29.     cout<<" Enter 1 For Insert"<<endl;
  30.     cout<<" Enter 2 For Search"<<endl;
  31.     cout<<" Enter 3 For Delete"<<endl;
  32.     cout<<" Enter 4 For Show"<<endl;
  33.     cout<<" Enter 5 For Update"<<endl;
  34.  
  35.     int n;
  36.     cin>>n;
  37.  
  38.     if(n ==1){
  39.         insertData();
  40.         cout<<"Data insert successfully \n";
  41.         menuBar();
  42.     }
  43.  
  44.  
  45.     if(n ==2){
  46.         searchData();
  47.          cout<<"Data  search successfully \n";
  48.         menuBar();
  49.     }
  50.  
  51.     if(n ==3){
  52.          deleteData();
  53.           cout<<"Data delete successfully \n";
  54.         menuBar();
  55.     }
  56.  
  57.     if(n ==4){
  58.     showData();
  59.      cout<<"Data show successfully \n";
  60.         menuBar();
  61.     }
  62.  
  63.  
  64.     if(n ==5){
  65.         updateData();
  66.          cout<<"Data  update successfully \n";
  67.         menuBar();
  68.     }
  69.  
  70.  
  71. }
  72.  
  73.  
  74. int main()
  75. {
  76.  
  77.   struct DataTable table[50];
  78.  
  79.     cin>>table[0].name;
  80.     cin>>table[0].type;
  81.  
  82.     cout<<table[0].name;
  83.     cout<<table[0].type;
  84.  
  85.     while(true){
  86.  
  87.     menuBar();
  88.  
  89.     }
  90.  
  91.  
  92.  
  93.     return 0;
  94. }
RAW Paste Data