Guest User

Untitled

a guest
Jun 21st, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.36 KB | None | 0 0
  1. //Refrence program
  2.  
  3. #include <iostream>
  4. #include<fstream>
  5.  
  6.  
  7. using namespace std;
  8.  
  9.  
  10.  
  11. int main()
  12. { // beginning of main function
  13. int name;
  14. int Choice;
  15. char Entry[120] = {'\0'};
  16. char Entry1[120] = {'\0'};
  17. int Second_Entry;
  18. int Choice_1;
  19. ofstream Entry_storage;
  20. ofstream Entry_storage1;
  21. ofstream Entry_storage2;
  22. ofstream Entry_storage3;
  23. ofstream Entry_storage4;
  24. ofstream Entry_storage5;
  25. ofstream Entry_storage6;
  26. ofstream Entry_storage7;
  27. ofstream Entry_storage8;
  28. ofstream Entry_storage9;
  29. ofstream Entry_storage10;
  30.  
  31.  
  32. Begin:
  33. cout<<"\t\t Refrence Entry 1.0, Created by Frosty\n";
  34. cout<<" \tRead the Readme.txt before Using this program!\n";
  35. cout<<"\n\n";
  36.  
  37. cout<<"Welcome to the Reference Program, what would you like to do ?\n\n\n";
  38. cout<<" 1. Create an Entry\n";
  39. cout<<" 2. View an Entry\n";
  40. cout<<" 3. Delete an Entry\n\n";
  41. cout<<"Choice: ";
  42. cin>>Choice;
  43. cin.get();
  44.  
  45. switch (Choice)
  46. {
  47.  
  48. case 1:
  49. system("CLS");
  50. cout<<"What number entry is this ?(Type the numer of the entry)\n";
  51. cout<<"(You can only store up to 10 Entrys)\n\n";
  52.  
  53. cin>>name;
  54. cin.get();
  55.  
  56. switch(name)
  57. {
  58. case 1:
  59. Entry_storage1.open("Entry 1.txt");
  60. Entry_storage1<<Entry1;
  61. Entry_storage1.close();
  62.  
  63.  
  64.  
  65. cout<<"Your Entry will be saved to Entry 1.txt";
  66. cin.get();
  67. break;
  68.  
  69. case 2:
  70. Entry_storage2.open("Entry2.txt");
  71.  
  72.  
  73. Entry_storage2.close();
  74. cout<<"Your Entry will be saved to Entry 2.txt";
  75. cin.get();
  76. break;
  77.  
  78. case 3:
  79. Entry_storage3.open("Entry 3.txt");
  80. Entry_storage3<<Entry;
  81.  
  82. Entry_storage3.close();
  83. cout<<"Your Entry will be saved to Entry 3.txt";
  84. cin.get();
  85. break;
  86.  
  87. case 4:
  88. Entry_storage4.open("Entry 4.txt");
  89. Entry_storage4<<Entry;
  90.  
  91. Entry_storage4.close();
  92. cout<<"Your Entry will be saved to Entry 4.txt";
  93. cin.get();
  94. break;
  95.  
  96. case 5:
  97. Entry_storage5.open("Entry 5.txt");
  98. Entry_storage5<Entry;
  99.  
  100. Entry_storage5.close();
  101. cout<<"Your Entry will be saved to Entry 5.txt";
  102. cin.get();
  103. break;
  104.  
  105. case 6:
  106. Entry_storage6.open("Entry 6.txt");
  107. Entry_storage6<<Entry;
  108.  
  109. Entry_storage6.close();
  110. cout<<"Your Entry will be saved to Entry 6.txt";
  111. cin.get();
  112. break;
  113.  
  114. case 7:
  115. Entry_storage7.open("Entry 7.txt");
  116. Entry_storage7<<Entry;
  117.  
  118. Entry_storage7.close();
  119. cout<<"Your Entry will be saved to Entry 6.txt";
  120. cin.get();
  121. break;
  122.  
  123. case 8:
  124. Entry_storage8.open("Entry 8.xt");
  125. Entry_storage8<<Entry;
  126.  
  127. Entry_storage8.close();
  128. cout<<"Your Entry will be saved to Entry 6.txt";
  129. cin.get();
  130. break;
  131.  
  132. case 9:
  133. Entry_storage9.open("Entry 9.txt");
  134. Entry_storage9<<Entry;
  135.  
  136. Entry_storage9.close();
  137. cout<<"Your Entry will be saved to Entry 6.txt";
  138. cin.get();
  139. break;
  140.  
  141. case 10:
  142. Entry_storage10.open("Entry 10.txt");
  143. Entry_storage10<<Entry;
  144.  
  145. Entry_storage10.close();
  146. cout<<"Your Entry will be saved to Entry 10.txt";
  147. cin.get();
  148. break;
  149.  
  150. }
  151.  
  152. system("CLS");
  153. cout<<"\n\n";
  154. cout<<"Press Enter to being Entry";
  155. cin.get();
  156.  
  157. system("CLS");
  158. cout<<" Start typing your entry here ( up to 120 characters)\n\n";
  159. cout<<" Press Enter once you've completed Entry\n\n";
  160. cin.get(Entry1, 119);
  161. cin.get();
  162. cout<<" Entry saved to Entry.txt \n\n";
  163. cin.get();
  164.  
  165. system("CLS");
  166. cout<<" What would you like to do now?\n\n";
  167. cout<<"5. View Entry\n";
  168. cout<<"6. Back to Main menu\n";
  169. cout<<"7. Delete Entry\n";
  170. cout<<"\n\n";
  171. cin.get();
  172.  
  173.  
  174. cin>>Second_Entry;
  175.  
  176. Entry_storage.open("Entry 1.txt");
  177. Entry_storage<<Entry;
  178.  
  179. Entry_storage.close();
  180. cin.get();
  181.  
  182. if (Second_Entry == 6)
  183. {
  184. system("CLS");
  185. goto Begin;
  186.  
  187. }
  188.  
  189. switch(Second_Entry);
  190. {
  191.  
  192. case 5:
  193. system("CLS");
  194. cout<<"Entry "<<name;
  195. cout<<"\n\n";
  196. cout<<Entry;
  197. cin.get();
  198.  
  199. system("CLS");
  200. cout<<"What would you like to do now?\n\n";
  201. cout<<"7. Main Menu\n";
  202. cout<<"8. Exit Program\n\n";
  203.  
  204.  
  205. cin>>Choice_1;
  206. if(Choice_1 == 7)
  207. { system("CLS");
  208. goto Begin;
  209.  
  210. }
  211.  
  212. else if(Choice_1 == 8)
  213.  
  214. { Exit:
  215. cout<<"Exiting";
  216.  
  217. }
  218.  
  219.  
  220. }
  221.  
  222.  
  223. case 2:
  224. system("CLS");
  225. cout<<"Please enter the full name of the Entry (The .txt)\n\n";
  226. cin.get();
  227.  
  228. }
  229.  
  230.  
  231. }
  232.  
  233.  
  234.  
  235.  
  236. // end of main function
Add Comment
Please, Sign In to add comment