Guest User

Untitled

a guest
Oct 11th, 2018
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.21 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <windows.h>
  4. #include <stdlib.h>
  5. #include <string.h>
  6. #include<fstream>
  7.  
  8.  
  9. using namespace std;
  10. int main()
  11. {
  12. int pta=280;
  13. int total;
  14. int ab=1;
  15. string user="ictcoor";
  16. string pass="123";
  17. string user1,line,pass1,data,data1,lrn,nogname1;
  18. int i,c,d,age;
  19. int gl,choice;
  20. char fn[20],sn[20],nm[50],nf[50],ng[50],nmb[12],ocm[30],rel[20],ocf[30],bertday[20];
  21. char bg[100],ct[50],sp[20],ccl[10], ps[4],zp[5];
  22.  
  23. char a=177,b=219;
  24. log:
  25. cout<<"\n"<<setw(51);
  26. cout<<"ADMINISTRATOR LOGIN";
  27. cout<<"\n"<<setw(37);
  28. cout<<"USER:";
  29. getline(cin,user1);
  30. cout<<"\n"<<setw(37);
  31. cout<<"PASSWORD:";
  32. getline(cin,pass1);
  33. if(pass1==pass&&user1==user){
  34. cout<<"\nACCESS GRANTED\n";
  35. system("pause>0");
  36. system("cls");
  37. cout<<"\n ******** ** ** ** \n";
  38. cout<<" /**///// /** /** /** \n";
  39. cout<<" /** ******* ****** ****** /** /** ********** ***** ******* ******\n";
  40. cout<<" /******* //**///**//**//* **////** /** /**//**//**//** **///**//**///**///**/ \n";
  41. cout<<" /**//// /** /** /** / /** /** /** /** /** /** /**/******* /** /** /** \n";
  42. cout<<" /** /** /** /** /** /** /** /** /** /** /**/**//// /** /** /** \n";
  43. cout<<" /******** *** /**/*** //****** *** *** *** /** /**//****** *** /** //** \n";
  44. cout<<" //////// /// // /// ////// /// /// /// // // ////// /// // //\n";
  45. cout<<" ** \n";
  46. cout<<" ** ** /** \n";
  47. cout<<" ****** //** ** ****** ****** ***** ********** \n";
  48. cout<<" **//// //*** **//// ///**/ **///**//**//**//**\n";
  49. cout<<" //***** /** //***** /** /******* /** /** /**\n";
  50. cout<<" /////** ** /////** /** /**//// /** /** /**\n";
  51. cout<<" ****** ** ****** //** //****** *** /** /**\n";
  52. cout<<" ////// // ////// // ////// /// // // \n";
  53. system("color 8b");
  54. cout<<"\n"<<setw(37)<<"LOADING...";
  55. cout<<"\n"<<setw(28);
  56. for(i=0;i<25;i++)
  57. {
  58. cout<<a;
  59. c=rand()%200;
  60. Sleep(c);
  61. cout<<"\r"<<setw(28);
  62. }
  63. for(i=0;i<25;i++)
  64. {
  65. cout<<b;
  66. d=rand()%150;
  67. Sleep(d);
  68. }
  69. cout<<"\n"<<setw(52);
  70. cout<<"Press Any Key To Continue";
  71.  
  72. system("pause>0");
  73. system("cls");
  74. menu:
  75.  
  76. cout<<"\n"<<setw(65)<<"========================================================";
  77. cout<<"\n"<<setw(65)<<"========================================================";
  78. cout<<"\n"<<setw(65)<<"=== MENU ===";
  79. cout<<"\n"<<setw(65)<<"=== 1. Add a new information ===";
  80. cout<<"\n"<<setw(65)<<"=== 2. View and Edit some infos. in the file ===";
  81. cout<<"\n"<<setw(65)<<"=== 3. Exit ===";
  82. cout<<"\n"<<setw(65)<<"========================================================";
  83. cout<<"\n"<<setw(65)<<"========================================================";
  84. cout<<"Choice:";
  85. cin>>choice;
  86. system("cls");
  87. if(choice==1){
  88. cout<<"\n\n\n"<<setw(45);
  89. cout<<"Student Name";
  90. cout<<"\n\n\n"<<setw(30);
  91. cout<<"First Name:";
  92. cin.ignore();
  93. cin.getline(fn, 20);
  94. cout<<setw(30);
  95. cout<<"Last Name:";
  96. cin.getline(sn, 20);
  97. cout<<setw(30);
  98. cout<<"Age:";
  99. cin>>age;
  100. cout<<setw(30);
  101. cout<<"Birth Date:";
  102. cin.ignore();
  103. cin.getline(bertday, 20);
  104. system("cls");
  105. cout<<"\n"<<setw(52);
  106. bin:
  107. cout<<"Learning Reference Number:";
  108. cout<<"\n"<<setw(28)<<"-->:";
  109.  
  110. getline(cin, lrn);
  111. if(lrn.length()==12){
  112. if(ab==0)
  113. {
  114. goto bin1;
  115. }
  116. system("cls");
  117. cout<<"\n"<<setw(32);
  118. cout<<"Religion:";
  119. cout<<"\n"<<setw(28)<<"-->:";
  120. cin.ignore();
  121. cin.getline(rel, 20);
  122. system("cls");
  123. jump :
  124. cout<<setw(50);
  125. cout<<"Your Grade Level next School Year:";
  126. cin>>gl;
  127. system("cls");
  128. switch(gl)
  129. {
  130. case 7:
  131. cout<<"\n"<<setw(51);
  132. cout<<"choose your curriculum\n";
  133. cout<<setw(58);
  134. cout<<"To select, choose from 1 to 7\n";
  135. cout<<setw(35);
  136. cout<<"1. STE\n";
  137. cout<<setw(37);
  138. cout<<"2. STVEP\n";
  139. cout<<setw(36);
  140. cout<<"3. SPFL\n";
  141. cout<<setw(35);
  142. cout<<"4. SPA\n";
  143. cout<<setw(35);
  144. cout<<"5. SPS\n";
  145. cout<<setw(35);
  146. cout<<"6. BEC\n";
  147. cout<<setw(35);
  148. cout<<"7. FFC\n";
  149. cout<<setw(32);
  150. cout<<"-->:";
  151. cin.ignore();
  152. cin.getline(ccl, 10);
  153. break;
  154. case 8:
  155. cout<<"\n"<<setw(51);
  156. cout<<"Select your previous curriculum\n";
  157. cout<<setw(58);
  158. cout<<"To select, choose from 1 to 7\n";
  159. cout<<setw(35);
  160. cout<<"1. STE\n";
  161. cout<<setw(37);
  162. cout<<"2. STVEP\n";
  163. cout<<setw(36);
  164. cout<<"3. SPFL\n";
  165. cout<<setw(35);
  166. cout<<"4. SPA\n";
  167. cout<<setw(35);
  168. cout<<"5. SPS\n";
  169. cout<<setw(35);
  170. cout<<"6. BEC\n";
  171. cout<<setw(35);
  172. cout<<"7. FFC\n";
  173. cout<<setw(32);
  174. cout<<"-->:";
  175. cin.ignore();
  176. cin.getline(ccl, 10);
  177. break;
  178. case 9:
  179. cout<<"\n"<<setw(51);
  180. cout<<"Select your previous curriculum\n";
  181. cout<<setw(58);
  182. cout<<"To select, choose from 1 to 7\n";
  183. cout<<setw(35);
  184. cout<<"1. STE\n";
  185. cout<<setw(37);
  186. cout<<"2. STVEP\n";
  187. cout<<setw(36);
  188. cout<<"3. SPFL\n";
  189. cout<<setw(35);
  190. cout<<"4. SPA\n";
  191. cout<<setw(35);
  192. cout<<"5. SPS\n";
  193. cout<<setw(35);
  194. cout<<"6. BEC\n";
  195. cout<<setw(35);
  196. cout<<"7. FFC\n";
  197. cout<<setw(32);
  198. cout<<"-->:";
  199. cin.ignore();
  200. cin.getline(ccl, 10);
  201. break;
  202. case 10:
  203. cout<<"\n"<<setw(51);
  204. cout<<"Select your previous curriculum\n";
  205. cout<<setw(58);
  206. cout<<"To select, choose from 1 to 7\n";
  207. cout<<setw(35);
  208. cout<<"1. STE\n";
  209. cout<<setw(37);
  210. cout<<"2. STVEP\n";
  211. cout<<setw(36);
  212. cout<<"3. SPFL\n";
  213. cout<<setw(35);
  214. cout<<"4. SPA\n";
  215. cout<<setw(35);
  216. cout<<"5. SPS\n";
  217. cout<<setw(35);
  218. cout<<"6. BEC\n";
  219. cout<<setw(35);
  220. cout<<"7. FFC\n";
  221. cout<<setw(32);
  222. cout<<"-->:";
  223. cin.ignore();
  224. cin.getline(ccl, 10);
  225. break;
  226. default:
  227. cout<<setw(42);
  228. cout<<"Please try again\n";
  229. goto jump;
  230.  
  231. }
  232. system("cls");
  233. if(strcmp(ccl,"STVEP")==0)
  234. {
  235. cout<<"\n"<<setw(51);
  236. cout<<"Choose your Specialization\n";
  237. cout<<setw(49);
  238. cout<<"To select, choose from 1 to 7\n";
  239. cout<<setw(34);
  240. cout<<"1. Programming\n";
  241. cout<<setw(26);
  242. cout<<"2. CNT\n";
  243. cout<<setw(31);
  244. cout<<"3. DRAFTING\n";
  245. cout<<setw(32);
  246. cout<<"4. ANIMATION\n";
  247. cout<<setw(20);
  248. cout<<"-->:";
  249.  
  250. cin.getline(sp, 20);
  251. }
  252. system("cls");
  253. cout<<"\n"<<setw(40);
  254. cout<<"ADDRESS\n";
  255. cout<<"\n"<<setw(31);
  256. cout<<"Barangay:";
  257. cin.getline(bg, 100);
  258. cout<<"\n"<<setw(31);
  259. cout<<"City/Municipality:";
  260. cin.getline(ct, 50);
  261. cout<<"\n"<<setw(31);
  262. cout<<"Zip Code:";
  263. cin.getline(zp, 5);
  264. system("cls");
  265. cout<<"\n"<<setw(40);
  266. cout<<"Are you a 4PS Member?:";
  267. cin.getline(ps, 10);
  268. if(strcmp(ps,"yes")==0)
  269. {
  270. pta=pta-100;
  271. total=pta+150+75;
  272. }
  273. system("cls");
  274. cout<<"\n"<<setw(38);
  275. cout<<"Name of Mother:";
  276. cin.getline(nm, 50);
  277. cout<<"\n"<<setw(38);
  278. cout<<"Occupation:";
  279. cin.getline(ocm, 30);
  280. system("cls");
  281. cout<<"\n"<<setw(38);
  282. cout<<"Name of Father:";
  283. cin.getline(nf, 50);
  284. cout<<"\n"<<setw(38);
  285. cout<<"Occupation:";
  286. cin.getline(ocf, 30);
  287. system("cls");
  288. cout<<"\n"<<setw(38);
  289. cout<<"Name of Guardian:";
  290. cin.getline(ng, 50);
  291. cout<<"\n"<<setw(38);
  292. cout<<"Contact Number:";
  293. cin.getline(nmb, 12);
  294. system("cls");
  295. bin1:
  296. cout<<"\n"<<setw(38);
  297. cout<<"WRITING DATA TO FILE...\n";
  298. cout<<"\n"<<setw(28);
  299. for(i=0;i<25;i++)
  300. {
  301. cout<<a;
  302. c=rand()%200;
  303. Sleep(c);
  304. cout<<"\r"<<setw(28);
  305. }
  306. for(i=0;i<25;i++)
  307. {
  308. cout<<b;
  309. d=rand()%150;
  310. Sleep(d);
  311. }
  312. cout<<"\n"<<setw(52);
  313. Sleep(1000);
  314. lrn+=".doc";
  315. ifstream nog(lrn.c_str());
  316. if(nog.is_open())
  317. {
  318. cout<<"\nERROR!!!!!!!\n";
  319. cout<<"\nfile exist\nPlease enter your lrn again idiot\n";
  320. ab=0;
  321. goto bin;
  322. }
  323.  
  324.  
  325.  
  326.  
  327. else{
  328. ofstream nog;
  329. nog.open(lrn.c_str());
  330. cout<<"\nDATA HAS BEEN SAVED!";
  331. nog<<"*/---------------------------------------------------------------------*/\n";
  332. nog<<" --STUDENT INFORMATION--";
  333. nog<<"\n*/---------------------------------------------------------------------*/";
  334. nog<<"\nNAME:"<<sn<<","<<fn;
  335. nog<<"\tAGE:"<<age;
  336. nog<<"\tBirth Date:"<<bertday;
  337. nog<<"\nReligion:"<<rel;
  338. nog<<"\nAddress:";
  339. nog<<"\nStreet/Barangay:"<<bg;
  340. nog<<"\nCity/Municipality:"<<ct;
  341. nog<<"\nZip Code:"<<zp;
  342. nog<<"\n*/---------------------------------------------------------------------*/\n";
  343. nog<<" --SOME IMPORTANT INFORMATION--";
  344. nog<<"\n*/---------------------------------------------------------------------*/";
  345. nog<<"\nLearner's Reference Number:"<<lrn;
  346. nog<<"\nGrade Level:"<<gl;
  347. nog<<"\tCurriculum:"<<ccl;
  348. if(strcmp(ccl,"STVEP")==0){
  349. nog<<"\t\tSpecialization:"<<sp;
  350. }
  351. nog<<"\n*/---------------------------------------------------------------------*/\n";
  352. nog<<" --PARENT INFORMATION--";
  353. nog<<"\n*/---------------------------------------------------------------------*/";
  354. nog<<"\nMother's Name:"<<nm;
  355. nog<<"\nReligion:"<<rel;
  356. nog<<"\nOccupation:"<<ocm;
  357. nog<<"\nFather's Name:"<<nf;
  358. nog<<"\nReligion:"<<rel;
  359. nog<<"\nOccupation:"<<ocf;
  360. nog<<"\n*/---------------------------------------------------------------------*/\n";
  361. nog<<" --GUARDIAN--";
  362. nog<<"\n*/---------------------------------------------------------------------*/";
  363. nog<<"\nGuardian's Name:"<<ng;
  364. nog<<"\nContact Number:"<<nmb;
  365. nog<<"\n*/---------------------------------------------------------------------*/\n";
  366. nog<<" --FEES--";
  367. nog<<"\n*/---------------------------------------------------------------------*/";
  368. nog<<"\nPTA = "<<pta<<".00 Php";
  369. nog<<"\nBRIGADA = 150.00 Php";
  370. nog<<"\nID = 75.00 Php";
  371. nog<<"\n\nTOTAL PAYMENT:"<<total<<".00 Php";
  372. nog<<"\n\nPlease proceed at the PTA Office to pay";
  373. goto menu;
  374. }}
  375. else
  376. {
  377. cout<<"\ntry again motherfucker"<<endl;
  378. system("pause>0");
  379. system("cls");
  380. goto bin;
  381. }
  382. }
  383. else if(choice==2)
  384. {
  385. cin.ignore();
  386. cout<<"Enter the name of the file"<<endl;
  387. getline(cin,nogname1);
  388. nogname1+=".doc";
  389. ifstream nog(nogname1.c_str());
  390. if(nog.is_open())
  391. {
  392. while(getline(nog,line))
  393. {
  394. cout<<line<<'\n';
  395. }
  396. cout<<"\n Search the data you want to change:";
  397. getline(cin,data);
  398. cout<<"Enter the data:";
  399. getline(cin,data1);
  400. while(getline(nog,line))
  401. {
  402. if(string::npos != line.find(data)){
  403. line.replace(line.find(data), data.length(), data1);
  404. }}
  405.  
  406.  
  407.  
  408.  
  409.  
  410. }
  411. else
  412. {
  413. cout<<"File not found motherfucker";
  414. goto menu;
  415. }
  416. }
  417. }
  418. else
  419. {
  420. cout<<"\nACCESS DENIED\n";
  421. goto log;
  422. }
  423.  
  424. return 0;
  425. }
Add Comment
Please, Sign In to add comment