Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<stdlib.h>
- #include<conio.h>
- #include<stdio.h>
- using namespace std;
- int main (){
- int a,b,c,d,e,f,sm,i,j,l,sf;
- int pt,dk; //variabel untuk menghapus teman
- int pil; //variabel pilihan.
- int data=0;
- int log;
- int jsn;
- int jfriend[100];
- int myfriend[100];
- int fdata[10]={0,0,0,0,0,0,0,0,0,0};
- int sama[100];
- int m[10]={0,0,0,0,0,0,0,0,0,0};
- int pic[10]={0,0,0,0,0,0,0,0,0,0};
- string confirmpass;
- string passcheck;
- string change;
- string friendemail[100][100];
- string friendname[100][100];
- string friendage[100][100];
- string friendgender[100][100];
- string friendusername[100][100];
- string usersearch;
- string namesearch;
- string emailsearch;
- string message[100][100];
- string sendme;
- string age[100];
- string name[100];
- string username[100];
- string password[100];
- string userlogin;
- string passlogin;
- string gender[100];
- string email[100];
- while(true){
- mainmenu:
- system("cls");
- cout<<"1. Login "<<endl;
- cout<<"2. Regisster "<<endl;
- cout<<"3. Quit "<<endl;
- cin>>pil;
- if(pil==3){system("cls"); cout<<"Are You Sure? "<<endl;
- cout<<"1. Back "<<endl<<"2. Exit "<<endl;
- cin>>pil; if(pil==2) return 0;
- else if(pil==1)continue;
- }
- else if (pil==1){
- system("cls");
- cout<<"Enter Username : ";cin>>userlogin;
- cout<<"Enter Password : ";cin>>passlogin;
- for (a=0;a<data;a++){
- if(username[a]== userlogin &&password[a]==passlogin)
- { system("cls");
- cout<<"You're Logged In !"<<endl;log=a;getch();
- break;
- }
- }
- if(username[a] != userlogin || password[a] !=passlogin)
- { system("cls");
- cout<<"Username Or Password Wrong"<<endl;getch(); continue;
- }
- }
- else if (pil==2){
- system("cls");
- cout<<"Enter You're Name : ";cin>>name[data];
- cout<<"Enter Your're Age : ";cin>>age[data];
- cout<<"1. Male "<<endl;
- cout<<"2. Female "<<endl;
- cout<<"Select Gender(1/2) : "<<endl;
- cin>>pil;
- if (pil==1)gender[data]="Male";
- if(pil==2)gender[data]="Female";
- cout<<"Enter You're Email : ";cin>>email[data];
- cout<<"Enter You're Username : ";cin>>username[data];
- cout<<"Enter Youre Password : ";cin>>password[data];
- cout<<"Confirm Password : ";cin>>confirmpass;
- if (password[data]!= confirmpass){
- system("cls");cout<<"Password Is Diffrent With Confirm Password";
- getch();continue;
- }
- for (a=0;a<data;a++){
- if (username[a]==username[data]){
- system("cls");cout<<"This Username Already Taken!";
- getch();goto mainmenu;
- }
- }
- data++;
- system("cls");
- cout<<"Register Succesfully";
- getch();
- continue;
- }
- else continue;
- while(true){
- balik: //goto balik
- system ("cls");
- cout<<"Welcome '"<<name[log]<<"'"<<endl;
- cout<<"1. See My Profile "<<endl;
- cout<<"2. Send Massage"<<endl;
- cout<<"3. See Draft "<<endl;
- cout<<"4. Friendlist "<<endl;
- cout<<"5. Add New Friend "<<endl;
- cout<<"6. Setting "<<endl;
- cout<<"7. Log out "<<endl;
- cin>>pil;
- switch(pil){
- case 1 :system("cls");
- if (pic[log]==0){
- for(i=0;i<4;i++){
- for (j=0;j<8;j++){
- if (j==0 ||j==7)cout<<"|";
- else if (i==3)cout<<"=";
- else if (i==0)cout<<"=";
- else cout<<" ";
- }cout<<endl;
- }cout<<endl;
- }
- if (pic[log]==1){
- cout<<"========"<<endl;
- l=2;
- i=1;
- do{ j=1;
- while (j<=l*4){
- if (j==l*2 && i%2==0)cout<<"v";
- else if (i%2==1 && j%2==1 && j>=i && j<=l*2 )cout<<"\\";
- else if (i%2==1 && j%2==1 && j<=l*4-i && j>=l*2 )cout<<"/";
- else if (i%2==0 && j%2==0 && j>=i && j<=l*2 )cout<<"\\";
- else if (i%2==0 && j%2==0 && j<=l*4-i && j>=l*2 )cout<<"/";
- else cout<<" ";
- j++;
- }cout<<endl; i++;
- }while (i<=l*2);
- cout<<"========"<<endl<<endl;
- }
- if(pic[log]==2){cout<<"======"<<endl;
- l=6;
- e=1;
- for (i=1;i<=l-1;i++){
- for(j=1;j<=l-1;j++) {
- if (j<l/2-e+1) {cout<<" ";}
- else if (j>l/2+e-1)cout<<" ";
- else cout<<"#";}
- cout<<endl;
- if (i<=l/2-1){e++;}
- else e--;
- }
- cout<<"======"<<endl<<endl;}
- if (pic[log]==3){cout<<"======"<<endl<<endl;;
- l=6;
- for(i=1;i<=l/3;i++){
- for(j=1;j<=l;j++){
- if (j==l/3-i+1)cout<<"/";
- else if(j==l/3+i )cout<<"\\";
- else if(j==l-i+1)cout<<"/";
- else cout<<" ";
- }
- cout<<endl;
- }
- cout<<endl;
- cout<<"======"<<endl<<endl;
- }
- cout<<"Name : "<<name[log]<<endl;
- cout<<"Age : "<<age[log]<<endl;
- cout<<"Gender : "<<gender[log]<<endl;
- cout<<"Email : "<<email[log]<<endl;
- cout<<"Username : "<<username[log]<<endl<<endl;
- cout<<"1. Change Profile Pic"<<endl;
- cout<<"2. Back "<<endl;
- cin>>pil;
- if (pil==2)break;
- if (pil==1){system("cls");
- cout<<"Select Picture"<<endl<<endl;
- cout<<"1. "<<endl;
- cout<<"============"<<endl;
- i=1;
- do{ j=1;
- while (j<=12){
- if (j==6 && i%2==0)cout<<"v";
- else if (i%2==1 && j%2==1 && j>=i && j<=6 )cout<<"\\";
- else if (i%2==1 && j%2==1 && j<=12-i && j>=6 )cout<<"/";
- else if (i%2==0 && j%2==0 && j>=i && j<=6 )cout<<"\\";
- else if (i%2==0 && j%2==0 && j<=12-i && j>=6 )cout<<"/";
- else cout<<" ";
- j++;
- }cout<<endl; i++;
- }while (i<=6);
- cout<<"============"<<endl<<endl;
- cout<<"2. "<<endl;
- cout<<"============"<<endl;
- l=12;
- e=1;
- for (i=1;i<=l-1;i++){
- for(j=1;j<=l-1;j++) {
- if (j<=l/2-e+1) {cout<<" ";}
- else if (j>=l/2+e-1)cout<<" ";
- else cout<<"#";}
- cout<<endl;
- if (i<=l/2-1){e++;}
- else e--;
- }
- cout<<"============"<<endl<<endl;
- cout<<"3. "<<endl;
- cout<<"============"<<endl<<endl<<endl;;
- l=12;
- for(i=1;i<=l/3;i++){
- for(j=1;j<=l;j++){
- if (j==l/3-i+1)cout<<"/";
- else if(j==l/3+i )cout<<"\\";
- else if(j==l-i+1)cout<<"/";
- else cout<<" ";
- }
- cout<<endl;
- }
- cout<<endl<<endl;
- cout<<"============"<<endl<<endl;
- cin>>pic[log];
- system("cls");
- cout<<"Pic Succesfull Change ";
- }
- getch();
- break;
- case 2 :
- system("cls");
- cout<<"Type a Message..."<<endl;
- getch(); system("cls");
- cin>>sendme;
- cout<<"Send To Email : ";cin>>emailsearch;
- for(a=0;a<data;a++){
- if (email[a]==emailsearch){
- e=a; break;}
- } if (email[a]!=emailsearch){
- break;
- }
- cout<<"Are You Sure Wanna Send This Message?"<<endl;
- cout<<"1. Yes "<<endl;
- cout<<"2. No "<<endl;
- cin>>pil;
- if (pil==1){
- system("cls");
- cout<<"Berhasil Mengirimkan Pesan "<<endl;
- getch();
- sendme += "\n===================================";
- sendme += "\nFrom : ";
- sendme +=email[log];
- sendme+= "\nto : ";
- sendme+=email[e];
- sendme += "\n===================================";
- message[log][m[log]]=sendme;
- message[e][m[e]]=sendme;
- m[e]++;
- m[log]++;
- }
- else if (pil==2) break;
- break;
- case 3 :
- if (m[log]==0){system("cls"); cout<<"There No Massage In Here"<<endl;
- getch ();
- break;
- }
- system("cls");
- for(a=0;a<m[log];a++){
- cout<<a+1<<". "<<message[log][a]<<endl;
- }cout<<"Select Massage : ";
- cin>>sm;
- system("cls");
- cout<<message[log][sm-1]<<endl<<endl;
- cout<<"===================================="<<endl;
- cout<<"1. Reply This Massage "<<endl;
- cout<<"2. Delete This Massage "<<endl;
- cout<<"3. Back "<<endl;
- cin>>pil;
- if(pil==1){}
- if(pil==2){
- system("cls");
- cout<<"Are You Sure Wanna Delete This Message "<<endl;
- cout<<"1. Yes "<<endl;
- cout<<"2. No "<<endl;
- cin>>pil;
- if (pil==1){
- message[log][m[sm]-1]=message[log][m[log]-1];
- message[log][m[log]-1]="";
- m[log]--;
- system("cls");
- cout<<"Message Succesful Deleted "<<endl;
- getch();
- break;
- }
- if (pil==2)break;
- }
- if (pil==3)break;
- break;
- case 4 :
- if (fdata[log]==0){system("cls");
- cout<<"You Have No Friend "<<endl;
- getch();
- break;
- }
- system("cls");
- for(a=0;a<fdata[log];a++){
- cout<<a+1<<". Nama\t\t: "<<friendname[log][a]<<endl;
- cout<<" Gender\t: "<<friendgender[log][a]<<endl;
- cout<<" Age\t\t: "<<friendage[log][a]<<endl<<endl;
- }
- cout<<"Select Friend "<<endl;
- cin>>sf;
- for (a=0;a<data;a++){
- if(friendusername[log][sf-1]==username[a])
- {
- pt=a;
- system("cls");
- if (pic[a]==0){
- for(i=0;i<4;i++){
- for (j=0;j<8;j++){
- if (j==0 ||j==7)cout<<"|";
- else if (i==3)cout<<"=";
- else if (i==0)cout<<"=";
- else cout<<" ";
- }cout<<endl;
- }cout<<endl;
- }
- if (pic[a]==1){
- cout<<"========"<<endl;
- l=2;
- i=1;
- do{ j=1;
- while (j<=l*4){
- if (j==l*2 && i%2==0)cout<<"v";
- else if (i%2==1 && j%2==1 && j>=i && j<=l*2 )cout<<"\\";
- else if (i%2==1 && j%2==1 && j<=l*4-i && j>=l*2 )cout<<"/";
- else if (i%2==0 && j%2==0 && j>=i && j<=l*2 )cout<<"\\";
- else if (i%2==0 && j%2==0 && j<=l*4-i && j>=l*2 )cout<<"/";
- else cout<<" ";
- j++;
- }cout<<endl; i++;
- }while (i<=l*2);
- cout<<"========"<<endl<<endl;
- }
- if(pic[a]==2){cout<<"======"<<endl;
- l=6;
- e=1;
- for (i=1;i<=l-1;i++){
- for(j=1;j<=l-1;j++) {
- if (j<l/2-e+1) {cout<<" ";}
- else if (j>l/2+e-1)cout<<" ";
- else cout<<"#";}
- cout<<endl;
- if (i<=l/2-1){e++;}
- else e--;
- }
- cout<<"======"<<endl<<endl;}
- if (pic[a]==3){cout<<"======"<<endl<<endl;;
- l=6;
- for(i=1;i<=l/3;i++){
- for(j=1;j<=l;j++){
- if (j==l/3-i+1)cout<<"/";
- else if(j==l/3+i )cout<<"\\";
- else if(j==l-i+1)cout<<"/";
- else cout<<" ";
- }
- cout<<endl;
- }
- cout<<endl;
- cout<<"======"<<endl<<endl;
- }
- cout<<"Nama\t: "<<name[a]<<endl;
- cout<<"Gender\t: "<<gender[a]<<endl;
- cout<<"Age\t: "<<age[a]<<endl;
- cout<<"Email\t: "<<email[a]<<endl;
- break;
- }
- }
- getch();
- cout<<endl;
- cout<<"1. Message With'"<<name[a]<<"' "<<endl;
- cout<<"2. Delete Friend "<<endl;
- cout<<"3. Back "<<endl;
- cin>>pil;
- if (pil==1){system("cls");
- cout<<"Type a Massage...";
- getch();
- system("cls");
- cin>>sendme;
- cout<<"Are You Sure Wanna Send This Message?"<<endl;
- cout<<"1. Yes "<<endl;
- cout<<"2. No "<<endl;
- cin>>pil;
- if (pil==1){
- system("cls");
- cout<<"Berhasil Mengirimkan Pesan "<<endl;
- getch();
- sendme += "\n=====================================";
- sendme += "\nFrom : ";
- sendme +=email[log];
- sendme+= "\nto : ";
- sendme+=email[a];
- sendme += "\n=====================================";
- message[log][m[log]]=sendme;
- message[a][m[a]]=sendme;
- m[a]++;
- m[log]++;
- }
- else if (pil==2) break;
- }
- if (pil==2){system("cls"); cout<<"Are you sure wanna Delete '"<<name[a]<<"' "<<endl;
- cout<<"1. Yes "<<endl;
- cout<<"2. No "<<endl;
- cin>>pil;
- if (pil==1){
- friendage[log][sf-1]=friendage[log][fdata[log]];
- friendname[log][sf-1]=friendname[log][fdata[log]];
- friendemail[log][sf-1]=friendemail[log][fdata[log]];
- friendusername[log][sf-1]=friendusername [log][fdata[log]];
- friendgender[log][sf-1]=friendgender[log][fdata[log]];
- fdata[log]--;
- for (a=0;a<fdata[pt];a++)
- if (friendusername[pt][a]==username[log]){
- dk=a;break;
- }
- friendage[pt][dk]=friendage[pt][fdata[pt]];
- friendname[pt][dk]=friendname[pt][fdata[pt]];
- friendemail[pt][dk]=friendemail[pt][fdata[pt]];
- friendusername[pt][dk]=friendusername [pt][fdata[pt]];
- friendgender[pt][dk]=friendgender[pt][fdata[pt]];
- fdata[pt]--;
- system("cls");
- cout<<"Friend Succefull Deleted ";
- getch();
- }
- if(pil==2)break;
- }
- if (pil==3)break;
- break;
- case 5 : system("cls"); cout<<"1. Search By Name "<<endl;
- cout<<"2. Search By Username "<<endl;
- cout<<"3. Search By Email "<<endl;
- cout<<"4. Find Friend On Database "<<endl;
- cin>>pil;
- if (pil==1){
- jsn=0;
- system("cls");
- cout<<"Enter Name : ";cin>>namesearch;
- for(a=0;a<data;a++){
- if (name[a]==namesearch){jsn++;}}
- system("cls");
- if(jsn>0) cout<<jsn<<" People Found!"<<endl;
- for(a=0;a<data;a++){
- if (a==log)continue;
- if (name[a]==namesearch){
- cout<<a+1<<". Name\t\t: "<<name[a]<<endl;
- cout<<" "<<"Gender\t: "<<gender[a]<<endl;
- cout<<" "<<"Age\t\t: "<<age[a]<<endl;
- }
- }
- if (jsn==0){cout<<"People Not Found! "<<endl;
- getch();break;}
- getch(); break;
- }
- else if (pil==3){cout<<"Enter Email : " ;cin>>emailsearch;
- for(a=0;a<data;a++){
- if(a==log)continue;
- if (email[a]==emailsearch){
- cout<<"Nama\t: "<<name[a]<<endl;
- cout<<"Gender\t: "<<gender[a]<<endl;
- cout<<"Age\t: "<<age[a]<<endl;
- break;
- }
- }
- if (email[a]!=emailsearch){cout<<"Email Not Found! "<<endl;getch();break;}
- getch();
- }
- else if (pil==2){cout<<"Enter Username : ";cin>>usersearch;
- for (a=0;a<data;a++){
- if (a==log)continue;
- if (username[a]==usersearch){
- cout<"Username Found! ";
- cout<<"Nama\t\t: "<<name[a]<<endl;
- cout<<"Gender\t: "<<gender[a]<<endl;
- cout<<"Age\t: "<<age[a]<<endl;
- break;
- }
- }if (username[a]!=usersearch){cout<<"Username Not Found! "<<endl;getch();break;}
- getch();
- }
- else if (pil==4){
- for (a=0;a<data;a++){
- if (a==log)continue;
- cout<<a+1<<". Nama\t\t: "<<name[a]<<endl;
- cout<<" Gender\t: "<<gender[a]<<endl;
- cout<<" Age\t: "<<age[a]<<endl;
- }
- }
- else {cout<<"There No choice for "<<pil; getch(); break;}
- if (pil==2 || pil==3){
- cout<<"1. Add This Friend "<<endl;
- cout<<"2. Back "<<endl;cin>>pil;
- if (pil==1){
- for (c=0;c<fdata[log];c++){
- if (sama[c]==a){
- cout<<"You're Already Add This Friend!" <<endl;
- getch();
- goto balik;
- }
- }
- friendname[log][fdata[log]]=name[a];
- friendage[log][fdata[log]]=age[a];
- friendgender[log][fdata[log]]=gender[a];
- friendusername[log][fdata[log]]=username[a];
- friendemail[log][fdata[log]]=email[a];
- friendname[a][fdata[a]]=name[log];
- friendage[a][fdata[a]]=age[log];
- friendgender[a][fdata[a]]=gender[log];
- friendusername[a][fdata[a]]=username[log];
- friendemail[a][fdata[a]]=email[log];
- fdata[log]++;
- fdata[a]++;
- sama[b]=a;b++;
- cout<<"Friend Succesful Added "<<endl;getch();break;
- }
- if (pil==2)break;
- }
- if (pil==1 || pil==4){
- cout<<"Select Friend Data : ";cin>>f;
- f=f-1;
- if (f==log){system("cls");
- cout<<"You Cant Add Yourself ";
- getch();}
- for (c=0;c<fdata[log];c++){
- if (sama[c]==f){
- cout<<"You're Already Add This Friend!" <<endl;
- getch();
- goto balik;
- }
- }
- system("cls");
- cout<<"Nama\t: "<<name[f]<<endl;
- cout<<"Gender\t: "<<gender[f]<<endl;
- cout<<"Age\t: "<<age[f]<<endl;
- cout<<"Add This Friend"<<endl;
- cout<<"1. Yes "<<endl;
- cout<<"2. No "<<endl;
- cin>>pil;
- if (pil==1){
- friendname[log][fdata[log]]=name[f];
- friendage[log][fdata[log]]=age[f];
- friendgender[log][fdata[log]]=gender[f];
- friendusername[log][fdata[log]]=username[f];
- friendemail[log][fdata[log]]=email[log];
- friendname[f][fdata[f]]=name[log];
- friendage[f][fdata[f]]=age[log];
- friendgender[f][fdata[f]]=gender[log];
- friendusername[f][fdata[f]]=username[log];
- fdata[log]++;
- fdata[f]++;
- sama[b]=a; b++;
- cout<<"Friend Succesful Added "<<endl;
- }getch();
- if (pil==2)break;
- }
- break;
- case 6: system("cls");
- cout<<"1. Edit Account "<<endl;
- cout<<"2. Change Password "<<endl;
- cout<<"3. Delete Account "<<endl;
- cout<<"4. Back To Menu "<<endl;
- cin>>pil;
- if (pil==4)break;
- if (pil==1){system("cls"); cout<<"Name : "<<name[log]<<endl;
- cout<<"Age : "<<age[log]<<endl;
- cout<<"Gender : "<<gender[log]<<endl;
- cout<<"Email : "<<email[log]<<endl;
- cout<<"Username : "<<username[log]<<endl<<endl;
- cout<<"1. Change Name "<<endl;
- cout<<"2. Change Age "<<endl;
- cout<<"3. Change Gender "<<endl;
- cout<<"4. Change Email "<<endl;
- cout<<"5. Back "<<endl;
- cin>>pil;
- if (pil==5)break;
- else if (pil==1){system("cls");
- cout<<"Name\t: "<<name[log];
- getch();
- system("cls");
- cout<<"Name\t: ";cin>>change;
- cout<<endl;
- cout<<"Save This Changed ?"<<endl<<endl;
- cout<<"1. Yes "<<endl<<"2.No ";cin>>pil;
- if (pil==1){ name[log]=change;
- system("cls");
- cout<<"Name Succesful Changed ";
- getch();break;}
- if (pil=2)break;
- }
- else if (pil==2){system("cls");
- cout<<"Age\t: "<<age[log];
- getch();
- system("cls");
- cout<<"Age\t: ";cin>>change;
- cout<<endl;
- cout<<"Save This Changed ?"<<endl<<endl;
- cout<<"1. Yes "<<endl<<"2.No ";cin>>pil;
- if (pil==1){ age[log]=change;
- system("cls");
- cout<<"Age Succesful Changed ";
- getch();break;}
- if (pil=2)break;
- }
- else if (pil==3){system("cls");
- cout<<"Gender\t: "<<gender[log];
- system("cls");
- cout<<"1. Male"<<endl;
- cout<<"2. Female"<<endl;
- cout<<"Choose Gender"<<endl;
- cin>>pil;
- if (pil=1)change="Male";
- if (pil=2)change="Female";
- cout<<endl;
- cout<<"Gender\t: "<<change<<endl;
- cout<<"Save This Changed ?"<<endl<<endl;
- cout<<"1. Yes "<<endl<<"2.No ";cin>>pil;
- if (pil==1){ gender[log]=change;
- system("cls");
- cout<<"Gender Succesful Changed ";
- getch();break;}
- if (pil=2)break;
- }
- else if (pil==4){system("cls");
- cout<<"Email\t: "<<email[log];
- getch();
- system("cls");
- cout<<"Email\t: ";cin>>change;
- cout<<endl;
- cout<<"Save This Changed ?"<<endl<<endl;
- cout<<"1. Yes "<<endl<<"2.No ";cin>>pil;
- if (pil==1){ email[log]=change;
- system("cls");
- cout<<"Email Succesful Changed ";
- getch();break;}
- if (pil=2)break;
- }
- }
- if (pil==2){
- system("cls");
- cout<<"Enter Your Old Password : ";cin>>passcheck;
- if (passcheck!=password[log]){
- system("cls");
- cout<<"Password Wrong!"<<endl;
- getch();
- break;
- }
- cout<<"Enter Your New Password : ";cin>>change;
- cout<<"Confirm Password : ";cin>>confirmpass;
- if (confirmpass!=change){
- cout<<"Confirm Password Not Same As Password"<<endl;
- getch(); break;
- }
- password[log]=change;
- system("cls");
- cout<<"Password Has Changed Succesfully "<<endl;
- getch();
- break;
- }
- if(pil==3){
- system("cls");
- cout<<"Are You Sure Wanna Delete This Account "<<endl;
- cout<<"1. Yes "<<endl;
- cout<<"2. No "<<endl;
- cin>>pil;
- if (pil==1){system ("cls");
- name[log]="This Account Has Deleted";
- age[log]="This Account Has Deleted";
- gender[log]="This Account Has Deleted";
- email[log]="This Account Has Deleted";
- username[log]=rand();
- password[log]=rand();
- system("cls");
- cout<<"Account Succeful Deleted";
- getch();
- goto mainmenu;
- }
- if (pil==2)break;
- getch();
- break;
- }
- break;
- case 7:system("cls");
- cout<<"Are You Sure Wanna Logged Out"<<endl;
- cout<<"1. Yes "<<endl;
- cout<<"2. No "<<endl;
- cin>>pil;
- if (pil==1)goto mainmenu;
- if (pil==2) break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement