#include<iostream>
#include <iomanip>
#include <stdlib.h>
#include <conio.h>
using namespace std;
int main()
{
string user,pass;
char pa;
string nama[15],matkul[20],ket,grade;
int nim[10],n;
float uts[5],uas[5],tugas[5],total[5];
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 Jumlah Siswa = ";cin>>n;
cout<<""<<endl;
for (i=1;i<=n;i++)
{
cout<<"Masukan NIM Siswa = ";cin>>nim[i];
cout<<"Masukan Nama Siswa = ";cin>>nama[i];
cout<<"Masukan Mata Kuliah = ";cin>>matkul[i];
cout<<"Masukan Nilai Tugas = ";cin>>tugas[i];
cout<<"Masukan Nilai UTS = ";cin>>uts[i];
cout<<"Masukan Nilai UAS = ";cin>>uas[i];
total[5] =tugas[5]+uts[5]+uas[5];
if(total[5]=85&&total[5]<=100)
{
grade="A";
ket="Lulus";
}
else
if(total[5]>=70&&total[5]<85)
{
grade="B";
ket="Lulus";
}
else
if(total[5]>=60&&total[5]<70)
{
grade="C";
ket="Lulus";
}
else
if(total[5]>=45&&total[5]<60)
{
grade="A";
ket="Gagal";
}
else
if(total[5]>=0&&total[5]<45)
{
grade="A";
ket="Gagal";
}
}
cout<<" Keterangan Siswa "<<endl;
cout<<""<<endl;
cout<<"--------------------------------------------------------------------------------------------------------------------------------------------------------"<<endl;
cout<<"| NIM | Nama | Mata Kuliah | Tugas | UTS | UAS | Total | Grade | Keterangan | "<<endl;
cout<<"--------------------------------------------------------------------------------------------------------------------------------------------------------"<<endl;
for(i=1;i<=n;i++)
{
cout<<"|"<<""<<setw(13)<<nim[i]<<"|";
cout<<""<<setw(14)<<nama[i]<<"|";
cout<<""<<setw(23)<<matkul[i]<<"|";
cout<<""<<setw(15)<<tugas[i]<<"|";
cout<<""<<setw(13)<<uts[i]<<"|";
cout<<""<<setw(13)<<uas[i]<<"|";
cout<<""<<setw(15)<<total[5]<<"|";
cout<<""<<setw(15)<<grade<<"|";
cout<<""<<setw(20)<<ket<<"|";
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;
}
No comments:
Post a Comment