#include <stdio.h>
using namespace std;
typedef struct
{
char nama[100];
int nim;
int tugas;
int UTS;
int UAS;
}A[100];
int main()
{
A nilai;
int pilihan;
int total;
float ipk;
cout << " \t \t Transkrip Nilai Mahasiswa " << endl;
cout << " \t \t ___________________________" << endl;
cout << endl;
cout << endl;
cout << " Jumlah Mahasiswa : "; cin >> pilihan;
cout << endl;
cout << endl;
for (int i = 0; i < pilihan ; i++)
{
cout << " NIM Mahasiswa : "; cin >> nilai[i].nim;
cout << " Nama Mahasiswa : "; cin >> nilai[i].nama;
cout << " ========================= " << endl;
cout << " Nilai Tugas : "; cin >> nilai[i].tugas;
cout << " Nilai UTS : "; cin >> nilai[i].UTS;
cout << " Nilai UAS : "; cin >> nilai[i].UAS;
cout << endl;
cout << endl;
}
for (int i = 0; i < pilihan ; i++)
{
cout << i+1 << " NIM MAhasiswa : " << nilai[i].nim << endl;
cout << " " << " Nama Mahasiswa : " << nilai[i].nama << endl;
cout << " " << " ______________________ " << endl;
total = nilai[i].tugas+nilai[i].UTS+nilai[i].UAS;
ipk = total/3;
cout << " " << " Nilai TOTAL \t : " << total << endl;
cout << " " << " Rata-rata Nilai : " << ipk << endl;
if ( ipk >= 80 )
{
cout << " " << " IPK \t \t : " << "A " ;
}
else if ( ipk >= 65 && ipk < 80 )
{
cout << " " << " IPK \t \t : " << "B " ;
}
else if ( ipk >=50 && ipk < 65)
{
cout << " " << " IPK \t \t : " << "C " ;
}
else if ( ipk >= 35 && ipk < 50)
{
cout << " " << " IPK \t \t : " << "D " ;
}
else
{
cout << " " << " IPK \t \t : " << "E " ;
}
cout << endl;
cout << endl;
}
}
Tampilan Hasil Program |
0 komentar:
Posting Komentar