Advertisement
Dewnan98

My Longest C++ Program ,So Far. (Array Data)

Dec 9th, 2016
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 18.83 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdlib.h>
  3. #include<conio.h>
  4. #include<stdio.h>
  5. using namespace std;
  6. int main (){
  7. int a,b,c,d,e,f,sm,i,j,l,sf;
  8. int pt,dk; //variabel untuk menghapus teman
  9. int pil; //variabel pilihan.
  10. int data=0;
  11. int log;
  12. int jsn;
  13. int jfriend[100];
  14. int myfriend[100];
  15. int fdata[10]={0,0,0,0,0,0,0,0,0,0};
  16. int sama[100];
  17. int m[10]={0,0,0,0,0,0,0,0,0,0};
  18. int pic[10]={0,0,0,0,0,0,0,0,0,0};
  19. string confirmpass;
  20. string passcheck;
  21. string change;
  22. string friendemail[100][100];
  23. string friendname[100][100];
  24. string friendage[100][100];
  25. string friendgender[100][100];
  26. string friendusername[100][100];
  27. string usersearch;
  28. string namesearch;
  29. string emailsearch;
  30. string message[100][100];
  31. string sendme;
  32. string age[100];
  33. string name[100];
  34. string username[100];
  35. string password[100];
  36. string userlogin;
  37. string passlogin;
  38. string gender[100];
  39. string email[100];
  40. while(true){
  41. mainmenu:
  42.         system("cls");
  43. cout<<"1. Login "<<endl;
  44. cout<<"2. Regisster "<<endl;
  45. cout<<"3. Quit "<<endl;
  46. cin>>pil;
  47. if(pil==3){system("cls"); cout<<"Are You Sure? "<<endl;
  48. cout<<"1. Back "<<endl<<"2. Exit "<<endl;
  49. cin>>pil; if(pil==2) return 0;
  50. else if(pil==1)continue;
  51. }
  52. else if (pil==1){
  53.         system("cls");
  54.     cout<<"Enter Username : ";cin>>userlogin;
  55.     cout<<"Enter Password : ";cin>>passlogin;
  56.     for (a=0;a<data;a++){
  57.         if(username[a]== userlogin &&password[a]==passlogin)
  58.     { system("cls");
  59.         cout<<"You're Logged In !"<<endl;log=a;getch();
  60. break;
  61.     }
  62.  
  63.     }
  64. if(username[a] != userlogin || password[a] !=passlogin)
  65.     { system("cls");
  66.         cout<<"Username Or Password Wrong"<<endl;getch(); continue;
  67.     }
  68.  
  69.  
  70. }
  71. else if (pil==2){
  72. system("cls");
  73. cout<<"Enter You're Name     : ";cin>>name[data];
  74. cout<<"Enter Your're Age     : ";cin>>age[data];
  75. cout<<"1. Male "<<endl;
  76. cout<<"2. Female "<<endl;
  77. cout<<"Select Gender(1/2) : "<<endl;
  78. cin>>pil;
  79. if (pil==1)gender[data]="Male";
  80. if(pil==2)gender[data]="Female";
  81. cout<<"Enter You're Email    :  ";cin>>email[data];
  82. cout<<"Enter You're Username : ";cin>>username[data];
  83. cout<<"Enter Youre Password  : ";cin>>password[data];
  84. cout<<"Confirm Password      : ";cin>>confirmpass;
  85. if (password[data]!= confirmpass){
  86.     system("cls");cout<<"Password Is Diffrent With Confirm Password";
  87.     getch();continue;
  88. }
  89.  
  90.  
  91. for (a=0;a<data;a++){
  92.     if (username[a]==username[data]){
  93.         system("cls");cout<<"This Username Already Taken!";
  94.         getch();goto mainmenu;
  95.     }
  96. }
  97.  
  98. data++;
  99. system("cls");
  100. cout<<"Register Succesfully";
  101. getch();
  102.  
  103. continue;
  104. }
  105. else continue;
  106.  
  107. while(true){
  108.     balik: //goto balik
  109. system ("cls");
  110. cout<<"Welcome '"<<name[log]<<"'"<<endl;
  111. cout<<"1. See My Profile "<<endl;
  112. cout<<"2. Send Massage"<<endl;
  113. cout<<"3. See Draft "<<endl;
  114. cout<<"4. Friendlist "<<endl;
  115. cout<<"5. Add New Friend "<<endl;
  116. cout<<"6. Setting "<<endl;
  117. cout<<"7. Log out "<<endl;
  118. cin>>pil;
  119.  
  120. switch(pil){
  121.  
  122. case 1 :system("cls");
  123. if (pic[log]==0){
  124. for(i=0;i<4;i++){
  125.     for (j=0;j<8;j++){
  126.         if (j==0 ||j==7)cout<<"|";
  127.             else if (i==3)cout<<"=";
  128.             else if (i==0)cout<<"=";
  129.         else cout<<" ";
  130.     }cout<<endl;
  131. }cout<<endl;
  132. }
  133.  
  134. if (pic[log]==1){
  135.     cout<<"========"<<endl;
  136. l=2;
  137. i=1;
  138. do{ j=1;
  139.     while (j<=l*4){
  140.             if (j==l*2 && i%2==0)cout<<"v";
  141.             else if (i%2==1 && j%2==1 && j>=i && j<=l*2  )cout<<"\\";
  142.             else if (i%2==1 && j%2==1 && j<=l*4-i && j>=l*2  )cout<<"/";
  143.             else if (i%2==0 && j%2==0 && j>=i && j<=l*2 )cout<<"\\";
  144.             else if (i%2==0 && j%2==0 && j<=l*4-i && j>=l*2  )cout<<"/";
  145.             else cout<<" ";
  146.             j++;
  147.  
  148.     }cout<<endl; i++;
  149. }while (i<=l*2);
  150. cout<<"========"<<endl<<endl;
  151.  
  152. }
  153. if(pic[log]==2){cout<<"======"<<endl;
  154. l=6;
  155. e=1;
  156. for (i=1;i<=l-1;i++){
  157.   for(j=1;j<=l-1;j++) {
  158.     if (j<l/2-e+1) {cout<<" ";}
  159.     else if (j>l/2+e-1)cout<<" ";
  160.     else cout<<"#";}
  161. cout<<endl;
  162. if (i<=l/2-1){e++;}
  163. else e--;
  164. }
  165. cout<<"======"<<endl<<endl;}
  166. if (pic[log]==3){cout<<"======"<<endl<<endl;;
  167. l=6;
  168.  for(i=1;i<=l/3;i++){
  169.     for(j=1;j<=l;j++){
  170.         if (j==l/3-i+1)cout<<"/";
  171.         else if(j==l/3+i )cout<<"\\";
  172.         else if(j==l-i+1)cout<<"/";
  173.         else cout<<" ";
  174.     }
  175.         cout<<endl;
  176.  
  177.     }
  178.     cout<<endl;
  179. cout<<"======"<<endl<<endl;
  180. }
  181.  
  182.          cout<<"Name     : "<<name[log]<<endl;
  183.          cout<<"Age      : "<<age[log]<<endl;
  184.          cout<<"Gender   : "<<gender[log]<<endl;
  185.          cout<<"Email    : "<<email[log]<<endl;
  186.          cout<<"Username : "<<username[log]<<endl<<endl;
  187. cout<<"1. Change Profile Pic"<<endl;
  188. cout<<"2. Back "<<endl;
  189. cin>>pil;
  190. if (pil==2)break;
  191. if (pil==1){system("cls");
  192.  
  193. cout<<"Select Picture"<<endl<<endl;
  194.  
  195. cout<<"1. "<<endl;
  196. cout<<"============"<<endl;
  197. i=1;
  198. do{ j=1;
  199.     while (j<=12){
  200.             if (j==6 && i%2==0)cout<<"v";
  201.             else if (i%2==1 && j%2==1 && j>=i && j<=6  )cout<<"\\";
  202.  
  203.             else if (i%2==1 && j%2==1 && j<=12-i && j>=6  )cout<<"/";
  204.             else if (i%2==0 && j%2==0 && j>=i && j<=6 )cout<<"\\";
  205.             else if (i%2==0 && j%2==0 && j<=12-i && j>=6  )cout<<"/";
  206.             else cout<<" ";
  207.             j++;
  208.  
  209.     }cout<<endl; i++;
  210. }while (i<=6);
  211. cout<<"============"<<endl<<endl;
  212. cout<<"2. "<<endl;
  213. cout<<"============"<<endl;
  214. l=12;
  215. e=1;
  216. for (i=1;i<=l-1;i++){
  217.   for(j=1;j<=l-1;j++) {
  218.     if (j<=l/2-e+1) {cout<<" ";}
  219.     else if (j>=l/2+e-1)cout<<" ";
  220.     else cout<<"#";}
  221. cout<<endl;
  222. if (i<=l/2-1){e++;}
  223. else e--;
  224. }
  225. cout<<"============"<<endl<<endl;
  226.  
  227. cout<<"3. "<<endl;
  228. cout<<"============"<<endl<<endl<<endl;;
  229. l=12;
  230.  for(i=1;i<=l/3;i++){
  231.     for(j=1;j<=l;j++){
  232.         if (j==l/3-i+1)cout<<"/";
  233.         else if(j==l/3+i )cout<<"\\";
  234.         else if(j==l-i+1)cout<<"/";
  235.         else cout<<" ";
  236.     }
  237.         cout<<endl;
  238.  
  239.     }
  240.     cout<<endl<<endl;
  241. cout<<"============"<<endl<<endl;
  242.  
  243. cin>>pic[log];
  244. system("cls");
  245. cout<<"Pic Succesfull Change ";
  246.  
  247. }
  248.  
  249.          getch();
  250.  
  251.  
  252.     break;
  253. case 2 :
  254.     system("cls");
  255. cout<<"Type a Message..."<<endl;
  256. getch(); system("cls");
  257. cin>>sendme;
  258. cout<<"Send To Email : ";cin>>emailsearch;
  259. for(a=0;a<data;a++){
  260.     if (email[a]==emailsearch){
  261.         e=a; break;}
  262. } if (email[a]!=emailsearch){
  263.     break;
  264.  
  265. }
  266. cout<<"Are You Sure Wanna Send This Message?"<<endl;
  267. cout<<"1. Yes "<<endl;
  268. cout<<"2. No "<<endl;
  269. cin>>pil;
  270. if (pil==1){
  271.         system("cls");
  272.     cout<<"Berhasil Mengirimkan Pesan "<<endl;
  273. getch();
  274. sendme += "\n===================================";
  275. sendme += "\nFrom : ";
  276. sendme +=email[log];
  277. sendme+= "\nto : ";
  278. sendme+=email[e];
  279. sendme += "\n===================================";
  280. message[log][m[log]]=sendme;
  281. message[e][m[e]]=sendme;
  282. m[e]++;
  283. m[log]++;
  284. }
  285.  
  286. else if (pil==2) break;
  287.  
  288. break;
  289.  
  290. case 3 :
  291.     if (m[log]==0){system("cls"); cout<<"There No Massage In Here"<<endl;
  292.     getch ();
  293.     break;
  294.     }
  295. system("cls");
  296. for(a=0;a<m[log];a++){
  297.     cout<<a+1<<". "<<message[log][a]<<endl;
  298. }cout<<"Select Massage : ";
  299. cin>>sm;
  300. system("cls");
  301. cout<<message[log][sm-1]<<endl<<endl;
  302. cout<<"===================================="<<endl;
  303. cout<<"1. Reply This Massage "<<endl;
  304. cout<<"2. Delete This Massage "<<endl;
  305. cout<<"3. Back "<<endl;
  306. cin>>pil;
  307.  
  308. if(pil==1){}
  309. if(pil==2){
  310.     system("cls");
  311.     cout<<"Are You Sure Wanna Delete This Message "<<endl;
  312.     cout<<"1. Yes "<<endl;
  313.     cout<<"2. No "<<endl;
  314.     cin>>pil;
  315.  
  316. if (pil==1){
  317.     message[log][m[sm]-1]=message[log][m[log]-1];
  318.     message[log][m[log]-1]="";
  319. m[log]--;
  320. system("cls");
  321. cout<<"Message Succesful Deleted "<<endl;
  322. getch();
  323. break;
  324.  
  325. }
  326. if (pil==2)break;
  327.  
  328. }
  329. if (pil==3)break;
  330. break;
  331.  
  332.  
  333. case 4 :
  334.     if (fdata[log]==0){system("cls");
  335. cout<<"You Have No Friend "<<endl;
  336.  
  337. getch();
  338. break;
  339. }
  340.     system("cls");
  341.     for(a=0;a<fdata[log];a++){
  342.  
  343.     cout<<a+1<<". Nama\t\t: "<<friendname[log][a]<<endl;
  344.     cout<<"   Gender\t: "<<friendgender[log][a]<<endl;
  345.     cout<<"   Age\t\t: "<<friendage[log][a]<<endl<<endl;
  346. }
  347. cout<<"Select Friend "<<endl;
  348. cin>>sf;
  349. for (a=0;a<data;a++){
  350.     if(friendusername[log][sf-1]==username[a])
  351. {
  352.     pt=a;
  353.  
  354.     system("cls");
  355.     if (pic[a]==0){
  356. for(i=0;i<4;i++){
  357.     for (j=0;j<8;j++){
  358.         if (j==0 ||j==7)cout<<"|";
  359.             else if (i==3)cout<<"=";
  360.             else if (i==0)cout<<"=";
  361.         else cout<<" ";
  362.     }cout<<endl;
  363. }cout<<endl;
  364. }
  365.  
  366. if (pic[a]==1){
  367.     cout<<"========"<<endl;
  368. l=2;
  369. i=1;
  370. do{ j=1;
  371.     while (j<=l*4){
  372.             if (j==l*2 && i%2==0)cout<<"v";
  373.             else if (i%2==1 && j%2==1 && j>=i && j<=l*2  )cout<<"\\";
  374.  
  375.  
  376.             else if (i%2==1 && j%2==1 && j<=l*4-i && j>=l*2  )cout<<"/";
  377.             else if (i%2==0 && j%2==0 && j>=i && j<=l*2 )cout<<"\\";
  378.             else if (i%2==0 && j%2==0 && j<=l*4-i && j>=l*2  )cout<<"/";
  379.             else cout<<" ";
  380.             j++;
  381.  
  382.     }cout<<endl; i++;
  383. }while (i<=l*2);
  384. cout<<"========"<<endl<<endl;
  385.  
  386. }
  387. if(pic[a]==2){cout<<"======"<<endl;
  388. l=6;
  389. e=1;
  390. for (i=1;i<=l-1;i++){
  391.   for(j=1;j<=l-1;j++) {
  392.     if (j<l/2-e+1) {cout<<" ";}
  393.     else if (j>l/2+e-1)cout<<" ";
  394.     else cout<<"#";}
  395. cout<<endl;
  396. if (i<=l/2-1){e++;}
  397. else e--;
  398. }
  399. cout<<"======"<<endl<<endl;}
  400. if (pic[a]==3){cout<<"======"<<endl<<endl;;
  401. l=6;
  402.  for(i=1;i<=l/3;i++){
  403.     for(j=1;j<=l;j++){
  404.         if (j==l/3-i+1)cout<<"/";
  405.         else if(j==l/3+i )cout<<"\\";
  406.         else if(j==l-i+1)cout<<"/";
  407.         else cout<<" ";
  408.     }
  409.         cout<<endl;
  410.  
  411.     }
  412.     cout<<endl;
  413. cout<<"======"<<endl<<endl;
  414. }
  415.  
  416.     cout<<"Nama\t: "<<name[a]<<endl;
  417.     cout<<"Gender\t: "<<gender[a]<<endl;
  418.     cout<<"Age\t: "<<age[a]<<endl;
  419.     cout<<"Email\t: "<<email[a]<<endl;
  420.     break;
  421.  
  422. }
  423.  }
  424. getch();
  425. cout<<endl;
  426. cout<<"1. Message With'"<<name[a]<<"' "<<endl;
  427. cout<<"2. Delete Friend "<<endl;
  428. cout<<"3. Back "<<endl;
  429. cin>>pil;
  430. if (pil==1){system("cls");
  431. cout<<"Type a Massage...";
  432. getch();
  433. system("cls");
  434. cin>>sendme;
  435.  
  436. cout<<"Are You Sure Wanna Send This Message?"<<endl;
  437. cout<<"1. Yes "<<endl;
  438. cout<<"2. No "<<endl;
  439. cin>>pil;
  440. if (pil==1){
  441.         system("cls");
  442.     cout<<"Berhasil Mengirimkan Pesan "<<endl;
  443. getch();
  444. sendme += "\n=====================================";
  445. sendme += "\nFrom : ";
  446. sendme +=email[log];
  447. sendme+= "\nto : ";
  448. sendme+=email[a];
  449. sendme += "\n=====================================";
  450. message[log][m[log]]=sendme;
  451. message[a][m[a]]=sendme;
  452. m[a]++;
  453. m[log]++;
  454. }
  455.  
  456. else if (pil==2) break;
  457.  
  458. }
  459. if (pil==2){system("cls"); cout<<"Are you sure wanna Delete '"<<name[a]<<"' "<<endl;
  460. cout<<"1. Yes "<<endl;
  461. cout<<"2. No "<<endl;
  462. cin>>pil;
  463. if (pil==1){
  464.  
  465.     friendage[log][sf-1]=friendage[log][fdata[log]];
  466.     friendname[log][sf-1]=friendname[log][fdata[log]];
  467.     friendemail[log][sf-1]=friendemail[log][fdata[log]];
  468.     friendusername[log][sf-1]=friendusername [log][fdata[log]];
  469.     friendgender[log][sf-1]=friendgender[log][fdata[log]];
  470.     fdata[log]--;
  471.     for (a=0;a<fdata[pt];a++)
  472.     if (friendusername[pt][a]==username[log]){
  473.         dk=a;break;
  474.     }
  475.  
  476.     friendage[pt][dk]=friendage[pt][fdata[pt]];
  477.     friendname[pt][dk]=friendname[pt][fdata[pt]];
  478.     friendemail[pt][dk]=friendemail[pt][fdata[pt]];
  479.     friendusername[pt][dk]=friendusername [pt][fdata[pt]];
  480.     friendgender[pt][dk]=friendgender[pt][fdata[pt]];
  481.     fdata[pt]--;
  482.     system("cls");
  483.     cout<<"Friend Succefull Deleted ";
  484.     getch();
  485. }
  486. if(pil==2)break;
  487.  
  488.  
  489. }
  490. if (pil==3)break;
  491.  
  492.  
  493. break;
  494. case 5 : system("cls"); cout<<"1. Search By Name "<<endl;
  495.                    cout<<"2. Search By Username "<<endl;
  496.                    cout<<"3. Search By Email "<<endl;
  497.                    cout<<"4. Find Friend On Database "<<endl;
  498.                    cin>>pil;
  499.         if (pil==1){
  500.                 jsn=0;
  501.                 system("cls");
  502.         cout<<"Enter Name : ";cin>>namesearch;
  503.         for(a=0;a<data;a++){
  504.             if (name[a]==namesearch){jsn++;}}
  505.              system("cls");
  506.                if(jsn>0) cout<<jsn<<" People Found!"<<endl;
  507.  
  508.  
  509.         for(a=0;a<data;a++){
  510.  
  511.                 if (a==log)continue;
  512.             if (name[a]==namesearch){
  513.         cout<<a+1<<". Name\t\t: "<<name[a]<<endl;
  514.         cout<<"   "<<"Gender\t: "<<gender[a]<<endl;
  515.         cout<<"   "<<"Age\t\t: "<<age[a]<<endl;
  516.             }
  517.         }
  518.  
  519.        if (jsn==0){cout<<"People Not Found! "<<endl;
  520.        getch();break;}
  521.       getch(); break;
  522.     }
  523. else if (pil==3){cout<<"Enter Email : " ;cin>>emailsearch;
  524. for(a=0;a<data;a++){
  525.         if(a==log)continue;
  526. if (email[a]==emailsearch){
  527.     cout<<"Nama\t: "<<name[a]<<endl;
  528.     cout<<"Gender\t: "<<gender[a]<<endl;
  529.     cout<<"Age\t: "<<age[a]<<endl;
  530.     break;
  531.  
  532. }
  533. }
  534.  
  535. if (email[a]!=emailsearch){cout<<"Email Not Found! "<<endl;getch();break;}
  536. getch();
  537. }
  538. else if (pil==2){cout<<"Enter Username : ";cin>>usersearch;
  539.     for (a=0;a<data;a++){
  540.             if (a==log)continue;
  541.         if (username[a]==usersearch){
  542.     cout<"Username Found! ";
  543.     cout<<"Nama\t\t: "<<name[a]<<endl;
  544.     cout<<"Gender\t: "<<gender[a]<<endl;
  545.     cout<<"Age\t: "<<age[a]<<endl;
  546.     break;
  547.         }
  548.     }if (username[a]!=usersearch){cout<<"Username Not Found! "<<endl;getch();break;}
  549.     getch();
  550. }
  551. else if (pil==4){
  552.         for (a=0;a<data;a++){
  553.         if (a==log)continue;
  554.     cout<<a+1<<". Nama\t\t: "<<name[a]<<endl;
  555.     cout<<"   Gender\t: "<<gender[a]<<endl;
  556.     cout<<"   Age\t: "<<age[a]<<endl;
  557.  
  558.         }
  559. }
  560. else {cout<<"There No choice for "<<pil; getch(); break;}
  561.  
  562. if (pil==2 || pil==3){
  563.     cout<<"1. Add This Friend "<<endl;
  564.     cout<<"2. Back "<<endl;cin>>pil;
  565.  
  566.  
  567.     if (pil==1){
  568.             for (c=0;c<fdata[log];c++){
  569.                     if (sama[c]==a){
  570.                         cout<<"You're Already Add This Friend!" <<endl;
  571.                         getch();
  572.                         goto balik;
  573.                     }
  574.             }
  575.  
  576.     friendname[log][fdata[log]]=name[a];
  577.     friendage[log][fdata[log]]=age[a];
  578.     friendgender[log][fdata[log]]=gender[a];
  579.     friendusername[log][fdata[log]]=username[a];
  580.     friendemail[log][fdata[log]]=email[a];
  581.     friendname[a][fdata[a]]=name[log];
  582.     friendage[a][fdata[a]]=age[log];
  583.     friendgender[a][fdata[a]]=gender[log];
  584.     friendusername[a][fdata[a]]=username[log];
  585.     friendemail[a][fdata[a]]=email[log];
  586.  
  587.     fdata[log]++;
  588.     fdata[a]++;
  589.     sama[b]=a;b++;
  590.     cout<<"Friend Succesful Added "<<endl;getch();break;
  591.  
  592.     }
  593.     if (pil==2)break;
  594.  
  595. }
  596. if (pil==1 || pil==4){
  597.     cout<<"Select Friend Data : ";cin>>f;
  598.     f=f-1;
  599.     if (f==log){system("cls");
  600.             cout<<"You Cant Add Yourself ";
  601.             getch();}
  602.     for (c=0;c<fdata[log];c++){
  603.                     if (sama[c]==f){
  604.                         cout<<"You're Already Add This Friend!" <<endl;
  605.                         getch();
  606.                         goto balik;
  607.                     }
  608.             }
  609.     system("cls");
  610.     cout<<"Nama\t: "<<name[f]<<endl;
  611.     cout<<"Gender\t: "<<gender[f]<<endl;
  612.     cout<<"Age\t: "<<age[f]<<endl;
  613.     cout<<"Add This Friend"<<endl;
  614.     cout<<"1. Yes "<<endl;
  615.     cout<<"2. No "<<endl;
  616.     cin>>pil;
  617.     if (pil==1){
  618.     friendname[log][fdata[log]]=name[f];
  619.     friendage[log][fdata[log]]=age[f];
  620.     friendgender[log][fdata[log]]=gender[f];
  621.     friendusername[log][fdata[log]]=username[f];
  622.     friendemail[log][fdata[log]]=email[log];
  623. friendname[f][fdata[f]]=name[log];
  624.     friendage[f][fdata[f]]=age[log];
  625.     friendgender[f][fdata[f]]=gender[log];
  626.     friendusername[f][fdata[f]]=username[log];
  627.  
  628.     fdata[log]++;
  629.     fdata[f]++;
  630.     sama[b]=a; b++;
  631.     cout<<"Friend Succesful Added "<<endl;
  632.     }getch();
  633. if (pil==2)break;
  634.  
  635. }
  636. break;
  637. case 6: system("cls");
  638. cout<<"1. Edit Account "<<endl;
  639. cout<<"2. Change Password "<<endl;
  640. cout<<"3. Delete Account "<<endl;
  641. cout<<"4. Back To Menu "<<endl;
  642. cin>>pil;
  643. if (pil==4)break;
  644. if (pil==1){system("cls"); cout<<"Name     : "<<name[log]<<endl;
  645.          cout<<"Age      : "<<age[log]<<endl;
  646.          cout<<"Gender   : "<<gender[log]<<endl;
  647.          cout<<"Email    : "<<email[log]<<endl;
  648.          cout<<"Username : "<<username[log]<<endl<<endl;
  649.  
  650. cout<<"1. Change Name "<<endl;
  651. cout<<"2. Change Age "<<endl;
  652. cout<<"3. Change Gender "<<endl;
  653. cout<<"4. Change Email "<<endl;
  654. cout<<"5. Back "<<endl;
  655. cin>>pil;
  656. if (pil==5)break;
  657. else if (pil==1){system("cls");
  658.     cout<<"Name\t: "<<name[log];
  659. getch();
  660. system("cls");
  661.     cout<<"Name\t: ";cin>>change;
  662.  
  663. cout<<endl;
  664. cout<<"Save This Changed ?"<<endl<<endl;
  665. cout<<"1. Yes "<<endl<<"2.No ";cin>>pil;
  666. if (pil==1){ name[log]=change;
  667. system("cls");
  668. cout<<"Name Succesful Changed ";
  669. getch();break;}
  670. if (pil=2)break;
  671. }
  672. else if (pil==2){system("cls");
  673.     cout<<"Age\t: "<<age[log];
  674. getch();
  675. system("cls");
  676.     cout<<"Age\t: ";cin>>change;
  677.  
  678. cout<<endl;
  679. cout<<"Save This Changed ?"<<endl<<endl;
  680. cout<<"1. Yes "<<endl<<"2.No ";cin>>pil;
  681. if (pil==1){ age[log]=change;
  682. system("cls");
  683. cout<<"Age Succesful Changed ";
  684. getch();break;}
  685. if (pil=2)break;
  686. }
  687. else if (pil==3){system("cls");
  688.     cout<<"Gender\t: "<<gender[log];
  689. system("cls");
  690.     cout<<"1. Male"<<endl;
  691.     cout<<"2. Female"<<endl;
  692. cout<<"Choose Gender"<<endl;
  693. cin>>pil;
  694. if (pil=1)change="Male";
  695. if (pil=2)change="Female";
  696.  
  697. cout<<endl;
  698. cout<<"Gender\t: "<<change<<endl;
  699. cout<<"Save This Changed ?"<<endl<<endl;
  700. cout<<"1. Yes "<<endl<<"2.No ";cin>>pil;
  701. if (pil==1){ gender[log]=change;
  702. system("cls");
  703. cout<<"Gender Succesful Changed ";
  704. getch();break;}
  705. if (pil=2)break;
  706. }
  707. else if (pil==4){system("cls");
  708.     cout<<"Email\t: "<<email[log];
  709. getch();
  710. system("cls");
  711.     cout<<"Email\t: ";cin>>change;
  712.  
  713. cout<<endl;
  714. cout<<"Save This Changed ?"<<endl<<endl;
  715. cout<<"1. Yes "<<endl<<"2.No ";cin>>pil;
  716. if (pil==1){ email[log]=change;
  717. system("cls");
  718. cout<<"Email Succesful Changed ";
  719. getch();break;}
  720. if (pil=2)break;
  721. }
  722.  
  723. }
  724. if (pil==2){
  725. system("cls");
  726. cout<<"Enter Your Old Password : ";cin>>passcheck;
  727. if (passcheck!=password[log]){
  728.     system("cls");
  729.     cout<<"Password Wrong!"<<endl;
  730.     getch();
  731.     break;
  732. }
  733. cout<<"Enter Your New Password : ";cin>>change;
  734. cout<<"Confirm Password        : ";cin>>confirmpass;
  735. if (confirmpass!=change){
  736.     cout<<"Confirm Password Not Same As Password"<<endl;
  737. getch(); break;
  738. }
  739. password[log]=change;
  740. system("cls");
  741. cout<<"Password Has Changed Succesfully "<<endl;
  742. getch();
  743. break;
  744.  
  745. }
  746. if(pil==3){
  747.     system("cls");
  748.     cout<<"Are You Sure Wanna Delete This Account "<<endl;
  749.     cout<<"1. Yes "<<endl;
  750.     cout<<"2. No "<<endl;
  751.     cin>>pil;
  752.  
  753. if (pil==1){system ("cls");
  754.         name[log]="This Account Has Deleted";
  755.         age[log]="This Account Has Deleted";
  756.         gender[log]="This Account Has Deleted";
  757.         email[log]="This Account Has Deleted";
  758.         username[log]=rand();
  759.         password[log]=rand();
  760.         system("cls");
  761.         cout<<"Account Succeful Deleted";
  762.     getch();
  763. goto mainmenu;
  764. }
  765. if (pil==2)break;
  766. getch();
  767. break;
  768. }
  769.  
  770. break;
  771. case 7:system("cls");
  772.     cout<<"Are You Sure Wanna Logged Out"<<endl;
  773.     cout<<"1. Yes "<<endl;
  774.     cout<<"2. No "<<endl;
  775.     cin>>pil;
  776. if (pil==1)goto mainmenu;
  777. if (pil==2) break;
  778.  
  779. }
  780. }
  781. }
  782. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement