/*pemgelolahan data Khs*/
#include<iostream.h>
#include<conio.h>
#include<string.h>
void main()
{
int no,ta,sem,i;
char nmk[50],nam[50],kode[10];
char A,B,C,D,E,nilai;
long bobot,sks,ipk,ips,khs;
char jawab;
jawab='Y';
khs=0;
ipk=0;
i=1;
/*masukkan*/
clrscr();
gotoxy(1,1);
cout<<"program pengelolahan data khs Mahasiswa \n";
gotoxy (1,2);
cout<<"Nama Mahasiswa : \n";
gotoxy (17,2);
cin>>nam;
gotoxy(28,2);
cout<<"Tahun ajaran : \n";
gotoxy(42,2);
cin>>ta;
gotoxy(28,3);
cout<<"No.Induk Mhs : \n";
gotoxy(42,3);
cin>>no;
gotoxy(1,3);
cout<<"Semester : \n";
gotoxy (17,3);
cin>>sem;
gotoxy(1,4);
cout<<"=========================================== \n";
gotoxy(1,5);
cout<<"| No. | Kode MK | Nama Mata Kuliah | SKS | Nilai | bobot |";
gotoxy(1,6);
cout<<"-------------------------------------------------------------";
do
{
gotoxy (1,6+i);
cout<<"| | | | | | |";
gotoxy(4,6+i);
cout<<""<<i<<"";
gotoxy(8,6+i);
cin>>kode;
gotoxy(24,6+i);
cin>>nmk;
gotoxy(37,6+i);
cin>>sks;
gotoxy(49,6+i);
cin>>nilai;
if (nilai=='A')
bobot=sks*4;
else if(nilai=='B')
bobot=sks*3;
else if(nilai=='C')
bobot=sks*2;
else if(nilai=='D')
bobot=sks*1;
else
bobot=sks*0;
gotoxy(55,6+i);
cout<<""<<bobot<<"";
/*hitungan*/
khs+=sks;
ipk+=bobot;
ips=ipk/khs;
gotoxy (20,23);
cout << "apakah mau mengisi lagi (Y/T) : ";
cin >> jawab;
cout <<"\n";
i+=1;
}
while(jawab=='Y' || jawab =='y');
gotoxy(1,6+i);
cout << "========================================================";
gotoxy (1,7+i);
cout <<" | | | | | | |";
gotoxy (25,7+i);
cout <<" total sks";
gotoxy (38,7+i);
cout <<khs<<"\n";
gotoxy(45,7+i);
cout <<" Bobot ";
cout <<ipk<<"\n";
gotoxy (1,8+i);
cout << "=====================================================\n";
gotoxy (1,9+i);
cout <<"Indeks Prestasi Semester : ";
gotoxy (27,9+i);
cout <<ips<<"\n";
}
Sekian dari saya semoga bisa bermanfaat dan apabila outputnya salah .mohon cermati coding nya. Trimakasih
Ditulis oleh: MUH RIDHO WACHID S
Tidak ada komentar:
Posting Komentar