Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<cstdlib>
- #include<iostream>
- using namespace std;
- static string login1()
- {
- string pengguna;
- cout<<"Masukkan username: ";
- cin>>pengguna;
- return pengguna;
- }
- static string login2()
- {
- string id;
- cout<<"Masukkan Id: ";
- cin>> id;
- return id;
- }
- static void konfigurasi (string user, string password)
- {
- bool error;error = true;
- while (error==true);
- {
- try
- {
- while (user !="nama" || password !="nim")
- {
- cout<<endl;
- cout<< "**Login Failed**";
- cout<<endl;
- user = login1();
- password = login2();
- }
- error = false;
- }
- catch (exception e)
- {
- cout<<endl;
- cout<<"#user & pasword salah:"<<endl;
- cout<<endl;
- }
- }
- }
- int main (int argc, char*argv[])
- {
- string user,password;
- user = login1();
- password= login2();
- konfigurasi (user,password);
- cout<<endl;
- cout<<" **selamat login sukses** :"<<endl;
- cout<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement