apl-mhd

hello.py

Jan 23rd, 2019
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.59 KB | None | 0 0
  1. class DataTable:
  2.  
  3.  
  4.     def __init__(self):
  5.         print("empty")
  6.  
  7.  
  8.  
  9.  
  10.     def menuBar(self):
  11.         print("Enter 1 For Insert", end="")
  12.         print("Enter 2 For Search")
  13.         print("Enter 3 For Delete")
  14.         print("Enter 4 For Show")
  15.         print('Enter 5 For Update')
  16.         print("__________________")
  17.         x =input()
  18.  
  19.         if x == '1':
  20.             self.insertData()
  21.  
  22.  
  23.         if x == '2':
  24.             self.searchData()
  25.  
  26.         if x == '3':
  27.             self.deleteData()
  28.  
  29.         if x == '4':
  30.             self.showData()
  31.  
  32.         if x == '5':
  33.             self.updateData()
  34.  
  35.         else:
  36.             print("invalid menu choice")
  37.             self.menuBar()
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.     #insertData()
  47.  
  48.     def insertData(self):
  49.         print("insert")
  50.         self.menuBar()
  51.  
  52.  
  53.  
  54.     def searchData(self):
  55.          print("search data")
  56.          self.menuBar()
  57.  
  58.     def deleteData(self):
  59.         print("delete")
  60.         self.menuBar()
  61.  
  62.  
  63.  
  64.     def showData(self):
  65.         print("shoe")
  66.         self.menuBar()
  67.  
  68.  
  69.     def updateData(self):
  70.         print("update")
  71.         self.menuBar()
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91. # #include <iostream>
  92. # #include <cstdio>
  93. #
  94. # using namespace std;
  95. #
  96. #
  97. # struct DataTable{
  98. #
  99. #     char name[30];
  100. #     char type[30];
  101. #
  102. # };
  103. #
  104. #
  105. # void insertData(){
  106. # }
  107. # void searchData(){
  108. # }
  109. # void deleteData(){
  110. # }
  111. # void showData(){
  112. # }
  113. # void updateData(){
  114. # }
  115. #
  116. #
  117. # void menuBar(){
  118. #
  119. #     cout<<" Enter 1 For Insert"<<endl;
  120. #     cout<<" Enter 2 For Search"<<endl;
  121. #     cout<<" Enter 3 For Delete"<<endl;
  122. #     cout<<" Enter 4 For Show"<<endl;
  123. #     cout<<" Enter 5 For Update"<<endl;
  124. #
  125. #     int n;
  126. #     cin>>n;
  127. #
  128. #     if(n ==1){
  129. #         insertData();
  130. #         cout<<"Data insert successfully \n";
  131. #         menuBar();
  132. #     }
  133. #
  134. #
  135. #     if(n ==2){
  136. #         searchData();
  137. #          cout<<"Data  search successfully \n";
  138. #         menuBar();
  139. #     }
  140. #
  141. #     if(n ==3){
  142. #          deleteData();
  143. #           cout<<"Data delete successfully \n";
  144. #         menuBar();
  145. #     }
  146. #
  147. #     if(n ==4){
  148. #     showData();
  149. #      cout<<"Data show successfully \n";
  150. #         menuBar();
  151. #     }
  152. #
  153. #
  154. #     if(n ==5){
  155. #         updateData();
  156. #          cout<<"Data  update successfully \n";
  157. #         menuBar();
  158. #     }
  159. #
  160. #
  161. # }
  162. #
  163. #
  164. # int main()
  165. # {
  166. #
  167. #   struct DataTable table[50];
  168. #
  169. #     cin>>table[0].name;
  170. #     cin>>table[0].type;
  171. #
  172. #     cout<<table[0].name;
  173. #     cout<<table[0].type;
  174. #
  175. #     while(true){
  176. #
  177. #     menuBar();
  178. #
  179. #     }
  180. #
  181. #
  182. #
  183. #     return 0;
  184. # }
Add Comment
Please, Sign In to add comment