Program C++ Menghitung IPK
#include<conio.h>
#include<stdio.h>
#include<iostream.h>
#include<iomanip.h>
main()
{
int i;
char nama[5][20];
float nilai1[5];
float nilai2[5];
float nilai3[5];
float nilai4[5];
float nilai5[5];
float nilai6[5];
float nilai7[5];
float nilai8[5];
float nilai9[5];
float nilai10[5];
float nilai11[5];
float nilai12[5];
float nilai13[5];
float nilai14[5];
float nilai15[5];
float nilai16[5];
float hasil[5];
float jam[5];
const sks=20;
clrscr();
for(i=1;i<=2;i++)
{
cout<<" -----PROGRAM MENGHITUNG IPK----";
cout<<"\n";
cout<<"\n";
cout<<"Data Ke - "<<i<<endl;
cout<<"Nama Mahasiswa : "; gets(nama[i]);
cout<<"Nilai Kalkulus : "; cin>>nilai1[i];
cout<<"Nilai Pend.Agama : "; cin>>nilai2[i];
cout<<"Nilai Pengantar Ekonomi : "; cin>>nilai3[i];
cout<<"Nilai PTI : "; cin>>nilai4[i];
cout<<"Nilai Dasar Akuntansi : "; cin>>nilai5[i];
cout<<"Nilai Pengantar Manajemen : "; cin>>nilai6[i];
cout<<"Nilai Algoritma & Struktur Data: "; cin>>nilai7[i];
cout<<"Nilai PPA : "; cin>>nilai8[i];
cout<<"Jumlah SKS : "<<20<<endl;
nilai9[i]=nilai1[i]*3;
nilai10[i]=nilai2[i]*2;
nilai11[i]=nilai3[i]*2;
nilai12[i]=nilai4[i]*2;
nilai13[i]=nilai5[i]*2;
nilai14[i]=nilai6[i]*2;
nilai15[i]=nilai7[i]*4;
nilai16[i]=nilai8[i]*3;
hasil[i] = ((nilai9[i] + nilai10[i] + nilai11[i] + nilai12[i] + nilai13[i] + nilai14[i]+nilai15[i]
+ nilai16[i])/20);
cout<<endl;
jam[i] = (nilai9[i] + nilai10[i] + nilai11[i] + nilai12[i] + nilai13[i] + nilai14[i]+nilai15[i]
+ nilai16[i]);
}
clrscr();
for(i=1;i<=2;i++)
{
cout<<"\n";
cout<<"Nama Mahasiswa : "<<nama[i]<<endl;
cout<<"Kalkulus : "<<nilai9[i]<<endl;
cout<<"Pendidikan Agama : "<<nilai10[i]<<endl;
cout<<"Pengantar Ekonomi : "<<nilai11[i]<<endl;
cout<<"PTI : "<<nilai12[i]<<endl;
cout<<"Dasar Akuntansi : "<<nilai13[i]<<endl;
cout<<"Pengantar Manajemen : "<<nilai14[i]<<endl;
cout<<"Algoritma & Struktur Data: "<<nilai15[i]<<endl;
cout<<"PPA : "<<nilai16[i]<<endl;
cout<<"Jumlah Angka Mutu adalah : "<<jam[i]<<endl;
cout<<"Jumlah SKS : "<<20<<endl;
cout<<"IPK anda adalah : "<<hasil[i]<<endl;
}
getch();
}
#include<stdio.h>
#include<iostream.h>
#include<iomanip.h>
main()
{
int i;
char nama[5][20];
float nilai1[5];
float nilai2[5];
float nilai3[5];
float nilai4[5];
float nilai5[5];
float nilai6[5];
float nilai7[5];
float nilai8[5];
float nilai9[5];
float nilai10[5];
float nilai11[5];
float nilai12[5];
float nilai13[5];
float nilai14[5];
float nilai15[5];
float nilai16[5];
float hasil[5];
float jam[5];
const sks=20;
clrscr();
for(i=1;i<=2;i++)
{
cout<<" -----PROGRAM MENGHITUNG IPK----";
cout<<"\n";
cout<<"\n";
cout<<"Data Ke - "<<i<<endl;
cout<<"Nama Mahasiswa : "; gets(nama[i]);
cout<<"Nilai Kalkulus : "; cin>>nilai1[i];
cout<<"Nilai Pend.Agama : "; cin>>nilai2[i];
cout<<"Nilai Pengantar Ekonomi : "; cin>>nilai3[i];
cout<<"Nilai PTI : "; cin>>nilai4[i];
cout<<"Nilai Dasar Akuntansi : "; cin>>nilai5[i];
cout<<"Nilai Pengantar Manajemen : "; cin>>nilai6[i];
cout<<"Nilai Algoritma & Struktur Data: "; cin>>nilai7[i];
cout<<"Nilai PPA : "; cin>>nilai8[i];
cout<<"Jumlah SKS : "<<20<<endl;
nilai9[i]=nilai1[i]*3;
nilai10[i]=nilai2[i]*2;
nilai11[i]=nilai3[i]*2;
nilai12[i]=nilai4[i]*2;
nilai13[i]=nilai5[i]*2;
nilai14[i]=nilai6[i]*2;
nilai15[i]=nilai7[i]*4;
nilai16[i]=nilai8[i]*3;
hasil[i] = ((nilai9[i] + nilai10[i] + nilai11[i] + nilai12[i] + nilai13[i] + nilai14[i]+nilai15[i]
+ nilai16[i])/20);
cout<<endl;
jam[i] = (nilai9[i] + nilai10[i] + nilai11[i] + nilai12[i] + nilai13[i] + nilai14[i]+nilai15[i]
+ nilai16[i]);
}
clrscr();
for(i=1;i<=2;i++)
{
cout<<"\n";
cout<<"Nama Mahasiswa : "<<nama[i]<<endl;
cout<<"Kalkulus : "<<nilai9[i]<<endl;
cout<<"Pendidikan Agama : "<<nilai10[i]<<endl;
cout<<"Pengantar Ekonomi : "<<nilai11[i]<<endl;
cout<<"PTI : "<<nilai12[i]<<endl;
cout<<"Dasar Akuntansi : "<<nilai13[i]<<endl;
cout<<"Pengantar Manajemen : "<<nilai14[i]<<endl;
cout<<"Algoritma & Struktur Data: "<<nilai15[i]<<endl;
cout<<"PPA : "<<nilai16[i]<<endl;
cout<<"Jumlah Angka Mutu adalah : "<<jam[i]<<endl;
cout<<"Jumlah SKS : "<<20<<endl;
cout<<"IPK anda adalah : "<<hasil[i]<<endl;
}
getch();
}
Comments
Post a Comment