Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdio.h>
- #include <string.h>
- #include <stdlib.h>
- using namespace std;
- main()
- {
- int pilih;
- string user="";
- string pass="";
- char kl[20];
- int y;
- char p;
- char pt;
- char py;
- char username[20];
- char password[20];
- char kata[100];
- char pganti;
- char ganti;
- char kata_[10];
- int i;
- int jum=1;
- int plih;
- cout<<"1.Register-------------------"<<endl;
- cout<<"2.Login----------------------"<<endl;
- cout<<"Ingin Register atau Login : ";
- cin>>plih;
- cout<<"-----------------------------"<<endl;
- if(plih==1)
- {
- goto regis;
- }
- else if(plih==2)
- {
- goto log;
- }
- system("cls");
- regis:
- cout<<endl;
- cout<<"--Silahkan Register--"<<endl;
- cout<<"---------------------"<<endl;
- cout<<"Input Username : ";
- cin.sync();
- gets(username);
- cout<<"Input Password : ";
- cin.sync();
- gets(password);
- system("cls");
- log:
- cout<<"-------------------"<<endl;
- cout<<"Ingin Login (Y/T) : ";
- cin>>pt;
- cout<<"-------------------"<<endl;
- if(pt=='Y' || pt=='y')
- {
- system("cls");
- cout<<"--Menu Login---"<<endl;
- cout<<"---------------"<<endl;
- cout<<"Username : ";
- cin>>user;
- cout<<"Password : ";
- cin>>pass;
- cout<<"---------------"<<endl;
- system("cls");
- }
- else if(pt=='T' || pt=='t')
- {
- exit(0);
- }
- awal :
- system("cls");
- if(user==username && pass==password)
- {
- cout<<"--Menu Pilihan---"<<endl;
- cout<<"-----------------"<<endl;
- cout<<"-----By Nang-----"<<endl;
- cout<<"1.Input"<<endl;
- cout<<"2.Edit"<<endl;
- cout<<"3.Manipulasi"<<endl;
- cout<<"4.Exit"<<endl;
- cout<<"-----------------"<<endl;
- cout<<"Input Pilihan : ";
- cin>>pilih;
- cout<<"--------------------"<<endl;
- switch(pilih)
- {
- case 1 :
- cout<<"Masukan Kalimat : ";
- cin.sync();
- gets(kata);
- break;
- case 2 :
- cout<<"Kata awal : "<<kata<<endl;
- cout<<"Input Kata yang Diganti : ";
- cin>>ganti;
- cout<<"Input Pengganti Huruf : ";
- cin>>pganti;
- for(i=1;i<strlen(kata);i++)
- {
- if(kata[i]==ganti)
- {
- kata[i]=pganti;
- }
- }
- cout<<"Kata Akhir : "<<kata<<endl;
- break;
- case 3 :
- if((kata[0]>='a') && (kata[0]<='z'))
- {
- kata[0]=kata[0]-32;
- }
- for(int i=0;i<strlen(kata);i++)
- {
- if((kata[jum]>='A') && (kata[jum]<='Z'))
- {
- kata[0]=kata[0]-32;
- }
- jum++;
- }
- for(int j=1;kata[j]!=NULL;j++)
- {
- if(kata[j+1]==NULL || kata[j+1]==' ')
- {
- kata[j]='%';
- }
- if(kata[j]==' ')
- {
- kata[j]='_';
- if(kata[j+1]>='a' && kata[j+1]<='z')
- {
- kata[j+1]=kata[j+1]-32;
- }
- }
- }
- cout<<"Hasil Kata : "<<kata;
- case 4 :
- exit(0);
- break;
- default :
- cout<<"Inputan Salah"<<endl;
- }
- }
- else
- {
- system("cls");
- cout<<"---------------------------"<<endl;
- cout<<"Salah Username dan Password"<<endl;
- cout<<"---------------------------"<<endl;
- }
- cout<<"-------------------------------"<<endl;
- cout<<"Ingin Ulang ke Menu Utama (Y/T) : ";
- cin>>py;
- cout<<"-------------------------------"<<endl;
- if(py=='Y' || py=='y')
- {
- goto awal;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement