#include<iostream>
#include<stdlib.h>
using namespace std;
int main() {
int i;
string pass_input, user_input;
cout << "==========================================" <<endl;
cout << " P R O G R A M L O G I N " <<endl;
cout << "==========================================" <<endl;
cout << "Silahkan Login jika ingin mengetahui nya.." <<endl;
cout << "==========================================" <<endl;
string username ="admin";
string password = "admin666";
string login = "invalid";
i = 1;
do {
cout << "Username = "; cin>>user_input;
cout << "Password = "; cin>>pass_input;
if (user_input == username && pass_input == password)
{
system("cls");
cout << "===========================================================" <<endl;
cout << " Login Berhasil .............................. " << endl;
cout <<endl<<endl;
cout << " Anda Telah Berhasil Membuat Program Password Sederhana " << endl <<endl; ;
cout << "===========================================================" <<endl;
cout << " Diatas adalah contoh login yg berhasil "<<endl;
i = 4;
login = "berhasil";
}
else
{
cout << "==========================================" <<endl;
cout << " Username / Password Salah! ("<<i<<"x)" <<endl;
cout << "==========================================" <<endl;
i = i +1;
}
} while (i <= 3);
if(login != "berhasil")
{
cout<<"Anda telah 3x salah login." <<endl;
cout<<"Silahkan coba 24 Jam lagi. Terima Kasih.." <<endl;
}
return 0;
}
No comments:
Post a Comment