Monday, 6 April 2020
Program Bayar SKS
#include<iostream>
#include <iomanip>
#include <stdlib.h>
#include <conio.h>
using namespace std;
int main()
{
string user,pass;
char pa;
int kode,jumlah,sks,semester;
string nama,nim,prodi;
cout<<"================== Login ===================="<<endl;
int i=1;
do
{
cout<<""<<endl;
cout<<"Silahkan Masukan Username Anda : ";cin>>user;
cout<<"Silahkan Masukan Password Anda : ";//cin>>pass;
pa=_getch();
while(pa !=13) {
pass.push_back(pa);
cout<<'*';
pa=_getch();
}
if(user=="algo"&&pass=="123456")
{
cout<<""<<endl;
cout<<""<<endl;
cout<<"Selamat Anda Berhasil Login...."<<endl;
{
cout<<endl;
cout<<"Masukan Nama = ";cin>>nama;
cout<<"Masukan NIM = ";cin>>nim;
cout<<"Masukan Jumlah SKS/Semester [10 - 24]= ";cin>>sks;
cout<<"Masukan KODE [1 - 3]= ";cin>>kode;
if (kode==1)
{
prodi="Teknik Informatika - S1";
jumlah=160000*sks;
}
else
if (kode==2)
{
prodi="Teknik Informatika - D3";
jumlah=160000*sks/2;
}
else
if (kode==3)
{
prodi="Sistem Informasi - S1";
jumlah=145000*sks;
}
else
{
prodi="Kode Tidak Ada";
}
cout<<""<<endl;
cout<<" DAFTAR BAYAR PER SEMESTER "<<endl;
cout<<""<<endl;
cout<<prodi<<endl;
cout<<""<<endl;
cout<<"-------------------------------------------------------------------"<<endl;
cout<<"| NIM | Nama | SKS | Bayar |"<<endl;
cout<<"-------------------------------------------------------------------"<<endl;
cout<<"|"<<""<<setw(13)<<nim<<"|";
cout<<""<<setw(16)<<nama<<"|";
cout<<""<<setw(11)<<sks<<"|";
cout<<""<<setw(16)<<"Rp."<<jumlah<<"|";
cout<<""<<endl;
cout<<"------------------------------------------------------------------"<<endl;
}
goto bawah;
}
else
{
cout<<""<<endl;
cout<<""<<endl;
cout<<"Gagal Masuk, Password atau Username Yang Anda Input Tidak Sesuai"<<endl;
}i++;
}
while(i<=3);
cout<<""<<endl;
cout<<"Anda telah 3x Memasukan Username dan Password yang salah"<<endl;
cout<<"Dengan Ini Saya Nyatakan Akun Anda Resmi Diblokir"<<endl;
cout<<endl;
bawah:
getch;
return 0;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment