Contoh Program Password C++

Assalamulaikum Wr.Wb




Pada kesempatan kali ini sya akan Share Tugas C++ yang merupakan tugas kampus. Langsung Cekidot Codingnya !


#include <iostream>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
int main()
{
    const string USERNAME = "Ikbal";
    const string PASSWORD = "12345";
    string username, password;
    awal:
char yt;
    system("cls");
cout <<""<<endl;
cout <<""<<endl;
cout <<""<<endl;
    cout << "                  ##                #######  #######  ##   ####       ##    "<< endl;
    cout << "                  ##               ##      ##  ##             ##  ##   ##    # #    "<< endl;
    cout << "                  ##               ##      ##  ##     ###  ##   ##     ##  ##    "<< endl;
    cout << "                  ##       ##    ##      ##  ##      ##  ##    ##       ####    "<< endl;
    cout << "                  #######     #######  #######  ##    ##         ###    "<< endl;
cout <<""<<endl;
cout <<""<<endl;
cout <<""<<endl;
    cout << "                              Enter Username : ";
    cin  >> username;
cout <<""<<endl;
    cout << "                              Enter Password : ";
    cin  >> password;
 
    if(username == USERNAME && password == PASSWORD)
    {
        for (int i=0; i<100; i++) {
cout<<endl;
cout<<endl;
        cout<<"                             L O A D I NG  ... "<<i<<" %"<<endl;
        system ("cls");
        }
cout<<endl;
cout<<endl;
        cout<<"                            LOADING COMPLETE"<<endl;
cout<<endl;
cout<<endl;
        cout << "                       ==  W  E  L  C  O  M E    ==" << endl;
cout<<endl;
        cout << "                        MUHAMMAD IKBAL MURSIDIN    " << endl;
cout<<endl;
        cout << "                       ============================" << endl;
    }
    else
{
for (int i=0; i<100; i++) {
cout<<endl;
cout<<endl;
cout<<endl;
        cout<<"                             L O A D I N G ... "<<i<< "%"<<endl;
        system ("cls");
     
}
cout <<endl;
cout <<endl;
    cout << "                                ==== M A A F === " << endl;
cout <<endl;
    cout << "                         Username dan Password Anda Salah " << endl;
cout <<endl;
    cout << "                         =================================" << endl;
    }
cout<<endl;
cout<<endl;
cout<<"                              T R Y  A G A I N  ? [Y/T] : ";
cin>>yt;
cout<<endl;

if(yt=='Y' || yt=='y')
{goto awal;}
if(yt=='T' || yt=='t')
{goto selesai;}
selesai:
    getch();

    return 0;
}

Ganti Tulisan Merah Dengan User Dan Password Anda !




Baca Juga " Contoh Program Rental mobil C++ "

Thank's Semoga Bermanfaat

Share !

0 Komentar