Advertisement
NdaX404

cpp andi

Mar 9th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.36 KB | None | 0 0
  1. #include <conio.h>
  2. #include <iostream.h>
  3. #include <stdio.h>
  4. #include <cstring.h>
  5.  
  6. main()
  7. {
  8.  
  9.  
  10. string username;
  11. char password[10], nama[20], jurusan[20], kelas[5], kateg[5];
  12.  
  13. cout<<"\t      +-------------------------+                    "<<endl;
  14. cout<<"\t +----|      Identitas User     |-------------------+"<<endl;
  15. cout<<"\t |    +-------------------------+                   |"<<endl;
  16. cout<<"\t |                                                  |"<<endl;
  17. cout<<"\t |       Nama Lengkap   : ";gets(nama);
  18. cout<<"\t |       Jurusan        : ";gets(jurusan);
  19. cout<<"\t |       Kelas          : ";gets(kelas);
  20. cout<<"\t |       Kategori       : ";gets(kateg);
  21. cout<<"\t |                                                  |"<<endl;
  22. cout<<"\t |   Tekan ( Enter ) Untuk Melanjutkan              |"<<endl;
  23. cout<<"\t |                                                  |"<<endl;
  24. cout<<"\t +--------------------------------------------------+"<<endl;
  25. getche();
  26. clrscr();
  27. goto attention;
  28.  
  29.  
  30. attention:
  31. cout<<"\t      +------------------------+                    "<<endl;
  32. cout<<"\t +----|      Attention !!!     |-------------------+"<<endl;
  33. cout<<"\t |    +------------------------+                   |"<<endl;
  34. cout<<"\t |                                                 |"<<endl;
  35. cout<<"\t |                                                 |"<<endl;
  36. cout<<"\t |  Jika Ingin Menggunakan Aplikasi ini Gunakan    |"<<endl;
  37. cout<<"\t |                                                 |"<<endl;
  38. cout<<"\t |         Username : siswa                        |"<<endl;
  39. cout<<"\t |         Password : tmkm                         |"<<endl;
  40. cout<<"\t |                                                 |"<<endl;
  41. cout<<"\t |  Tekan ( Enter ) Untuk Melanjutkan              |"<<endl;
  42. cout<<"\t |                                                 |"<<endl;
  43. cout<<"\t +-------------------------------------------------+"<<endl;
  44.  
  45. getche();
  46. clrscr();
  47. goto login;
  48.  
  49. login:
  50. cout<<"\t      +------------------------+                    "<<endl;
  51. cout<<"\t +----|      Please Login      |-------------------+"<<endl;
  52. cout<<"\t |    +------------------------+                   |"<<endl;
  53. cout<<"\t |                                                 |"<<endl;
  54. cout<<"\t |        Username : ";cin>>username;
  55. cout<<"\t |        Password : ";cin>>password;
  56. cout<<"\t |                                                 |"<<endl;
  57. cout<<"\t |   Tekan ( Enter ) Untuk Melanjutkan             |"<<endl;
  58. cout<<"\t |                                                 |"<<endl;
  59. cout<<"\t +-------------------------------------------------+"<<endl;
  60.  
  61.     if(username=="siswa" && strcmp(password, "tmkm")==0)
  62.     {
  63.         clrscr();
  64.             cout<<"\t      +------------------------+                    "<<endl;
  65.             cout<<"\t +----|      Status Login      |-------------------+"<<endl;
  66.             cout<<"\t |    +------------------------+                   |"<<endl;
  67.             cout<<"\t |                                                 |"<<endl;
  68.             cout<<"\t |                                                 |"<<endl;
  69.             cout<<"\t |   Login SUKSES                                  |"<<endl;
  70.             cout<<"\t |                                                 |"<<endl;
  71.             cout<<"\t |  Tekan ( Enter ) Untuk Melanjutkan              |"<<endl;
  72.             cout<<"\t |                                                 |"<<endl;
  73.             cout<<"\t +-------------------------------------------------+"<<endl;
  74.             getche();
  75.             clrscr();
  76.             goto mainmenu;
  77.  
  78.  
  79.       } else
  80.         {
  81.             clrscr();
  82.             cout<<"\t      +------------------------+                    "<<endl;
  83.             cout<<"\t +----|      Status Login      |-------------------+"<<endl;
  84.             cout<<"\t |    +------------------------+                   |"<<endl;
  85.             cout<<"\t |                                                 |"<<endl;
  86.             cout<<"\t |                                                 |"<<endl;
  87.             cout<<"\t |   Login GAGAL                                   |"<<endl;
  88.             cout<<"\t |                                                 |"<<endl;
  89.             cout<<"\t |  Tekan ( Enter ) Untuk Login Kembali            |"<<endl;
  90.             cout<<"\t |                                                 |"<<endl;
  91.             cout<<"\t +-------------------------------------------------+"<<endl;
  92.             getche();
  93.             clrscr();
  94.             goto login;
  95.          }
  96.  
  97. mainmenu:
  98. getch();
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement