Advertisement
Guest User

TUGAS BESAR ALPRO WOI DEADLINE BENTAR LAGI

a guest
Dec 12th, 2019
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 8.01 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <conio.h>
  4. #include <windows.h>
  5. #include <stdio.h>
  6.  
  7. void gotoxy(int x, int y){
  8.     COORD k = {x,y};
  9.     SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), k);
  10. }
  11. using namespace std;
  12. char nama[30],alamat[60],noHP[60],PilKategori,kategoriCucian[30];
  13. int biaya,jumlah,totaljumlah;
  14. char pilih,pilihan;
  15. int x,y;
  16. string un[50],passwd[50],konf[50],user,pass;
  17.  
  18. int main(){
  19.         x=2;
  20.         un[1] = "admin";
  21.         passwd[1] = "admin";
  22.         atas:
  23.         system("cls");
  24.         gotoxy(42,2);cout << "SELAMAT DATANG DI APLIKASI LAUNDRYKU";
  25.         gotoxy(21,3);cout << "SILAHKAN LOGIN KE AKUN ANDA";
  26.         cout << endl;
  27.         gotoxy(21,4);cout << "Apakah Anda Belum Memiliki Akun? Silahkan Membuat akun baru(y/t) : ";
  28.         cin>>pilih;
  29.         gotoxy(21,5);cout << "LOADING...";
  30.         Sleep (2000);
  31.         cout << ".....";
  32.         if (pilih == 'y'){
  33.         yo:
  34.         system("cls");
  35.         gotoxy(45,2);cout << " MENU PENDAFTARAN AKUN LAUNDRYKU ";
  36.         gotoxy(21,3);cout << "Masukkan username: ";
  37.         cin >> un[x];
  38.         gotoxy(21,4);cout << "Masukkan password anda: ";
  39.         cin >> passwd[x];
  40.         gotoxy(21,5);cout << "Masukkan lagi password anda: ";
  41.         cin >> konf[x];
  42.         gotoxy(21,6);cout << "LOADING...";
  43.         Sleep (2000);
  44.         cout << ".....";
  45.             system("cls");
  46.             if (konf[x] == passwd[x]){
  47.             gotoxy(35,4);cout << "Selamat Anda berhasil registrasi akun di laundryku";
  48.             gotoxy(38,5);cout << "Silahkan Tekan enter untuk menuju Menu Login";
  49.             getch();
  50.             goto ho;
  51.             }
  52.             else{
  53.             gotoxy(42,4);cout << "Password yang anda masukkan berbeda";
  54.             cout << endl;
  55.             gotoxy(41,5);cout << "Masukkan ulang username dan password anda";
  56.             getch();
  57.             goto yo;
  58.         }
  59.         x++;
  60.         }
  61.         else{
  62.             ho:
  63.             int su=3;
  64.             hi:
  65.             system("cls");
  66.             gotoxy(46,2);cout << "LOGIN KE APLIKASI LAUNDRYKU";
  67.             cout << endl;
  68.             gotoxy(21,3);cout << "Masukkan username     : ";
  69.             cin >> user;
  70.             gotoxy(21,4);cout << "Masukkan password anda: ";
  71.             cin >>pass;
  72.             for (y=1; y<=x; y++){
  73.                 if (user == un[y]){
  74.                     if (pass == passwd[y]){
  75.                         gotoxy(21,5);cout << "LOADING...";
  76.                         Sleep (2000);
  77.                         cout << ".....";
  78.                         system("cls");
  79.                         cout << endl;
  80.                         gotoxy(48,6);cout << "Anda login sebagai "<<user;
  81.                         gotoxy(39,7);cout << "lanjutkan masuk ke menu aplikasi Laundryku";
  82.                         getch();
  83.                         system("cls");
  84.                         gotoxy(34,2);cout<<"====================================================";
  85.                         gotoxy(34,3);cout<<"\t\t  Program Laundry Pakaian";
  86.                         gotoxy(34,4);cout<<"====================================================";
  87.                         gotoxy(34,6);cout<<"----------------------------------------------------";
  88.                         gotoxy(34,7);cout<<"\t\t     Input Data Pesanan";
  89.                         gotoxy(34,8);cout<<"----------------------------------------------------";
  90.                         gotoxy(34,9);cout<<"Nama Pelanggan          : ";
  91.                         cin>>nama;
  92.                         gotoxy(34,10);cout<<"Alamat                  : ";
  93.                         cin>>alamat;
  94.                         gotoxy(34,11);cout<<"No Handphone            : ";
  95.                         cin>>noHP;
  96.                         gotoxy(34,12);cout<<"----------------------------------------------------";
  97.                         gotoxy(34,13);cout<<"\t\t      Kategori Cucian";
  98.                         gotoxy(34,14);cout<<"----------------------------------------------------";
  99.                         gotoxy(34,15);cout<<"1. Reguler(3 hari)";
  100.                         gotoxy(34,16);cout<<"2. Ekspress (2 hari)";
  101.                         gotoxy(34,17);cout<<"3. Kilat (1 hari)";
  102.                         gotoxy(34,18);cout<<"----------------------------------------------------";
  103.                         gotoxy(34,19);cout<<"Input No Kategori [1-3] : ";
  104.                         cin>>PilKategori;
  105.                           switch(PilKategori)
  106.                            {
  107.                            case '1' :
  108.                            strcpy(kategoriCucian,"Cuci Reguler 3 Hari ");
  109.                            biaya=3000;
  110.                            break;
  111.                            case '2' :
  112.                            strcpy(kategoriCucian,"Cuci Ekspress 2 Hari ");
  113.                            biaya=6000;
  114.                            break;
  115.                            case '3' :
  116.                            strcpy(kategoriCucian,"Cuci Kilat 1 Hari ");
  117.                            biaya=9000;
  118.                            break;
  119.                            default:
  120.                            strcpy(kategoriCucian, "tanda salah kode");
  121.                            break;
  122.                            }
  123.                          gotoxy(34,20);cout<<"jumlah Cucian (/5 pcs)  : ";
  124.                          cin>>jumlah;
  125.                          system ("cls");
  126.                          gotoxy(28,2);cout<<"------------------------------------------------------------------";
  127.                          gotoxy(50,3);cout<<"Resi Pesanan Laundry"<<endl;
  128.                          gotoxy(28,4);cout<<"------------------------------------------------------------------";
  129.                          gotoxy(28,5);cout<<"Nama Pelanggan     : "<<nama;
  130.                          gotoxy(28,6);cout<<"Alamat             : "<<alamat;
  131.                          gotoxy(28,7);cout<<"No Handphone       : "<<noHP;
  132.                          gotoxy(28,8);cout<<kategoriCucian<<" : Rp. "<<biaya;
  133.                          totaljumlah=biaya*jumlah;
  134.                          gotoxy(28,9);cout<<"Total Biaya        : Rp. "<<totaljumlah;
  135.                          gotoxy(28,10);cout<<"-----------------------------------------------------------------";
  136.                          gotoxy(28,12);cout<<"-----------------------------------------------------------------";
  137.                          gotoxy(32,13);cout<<"Terima kasih telah Memesan Jasa Pencucian di laundry kami";
  138.                          gotoxy(28,14);cout<<"Pakaian anda akan kami ambil dan akan di antar jika sudah selesai";
  139.                          gotoxy(30,15);cout<<"Silahkan Screenshoot/simpan resi ini Sampai pembayaran Selesai";
  140.                          cout<<""<<endl;
  141.                          getch();
  142.                          system("cls");
  143.                          gotoxy(36,4);cout<<"Apakah anda ingin Memesan jasa kami lagi? (y/t)";
  144.                          cin>>pilihan;
  145.                          if (pilihan=='y'){
  146.                             goto hi;
  147.                          }
  148.                          else if(pilihan=='t'){
  149.                             exit(0);
  150.                             getch();
  151.                          }
  152.                          else {
  153.                             exit(0);
  154.                          }
  155.  
  156.                     }
  157.                     else{
  158.                         if (su==1){
  159.                             system("cls");
  160.                             cout << "ANDA TERLALU BANYAK MENCOBA MASUK"<<endl;
  161.                             cout << "COBA BEBERAPA SAAT LAGI!!";
  162.                             exit (0);
  163.                         }
  164.                         su=su-1;
  165.                         system("cls");
  166.                         cout << "kata sandi salah, kesempatan anda sisa "<<su<<" kali";
  167.                         getch();
  168.                         goto hi;
  169.  
  170.                     }
  171.                 }
  172.             }
  173.                 system("cls");
  174.                 cout << "username yang anda masukkan salah";
  175.                 getch();
  176.                 goto ho;
  177.         }
  178.  return 0;
  179. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement