Pages

Subscribe:

Labels

Cool Blue Outer Glow Pointer

Minggu, 30 Desember 2012

Program Hitung IPK


#include <iostream>
#include <string>
using namespace std;

int main()
{
float agama,pancasila,logma,alpro,pti,prak,kalkul,hasil,totalmk,totalsks;
char A,a,B,b,C,c,D,d,E,e,q,w,r,t,y,u,i,z;
string nama;
    cout<<"================================================="<<endl;
    cout<<"|+++++     PROGRAM HITUNG IPK SEMESTER 1    +++++|"<<endl;
    cout<<"================================================="<<endl<<endl;
    cout << "Nama Mahasiswa     : ";getline(cin,nama);
    cout << "Pendidikan agama   : ";cin>>q;
    cout << "Pancasila          : ";cin>>w;
    cout << "Logma              : ";cin>>r;
    cout << "Alpro              : ";cin>>t;
    cout << "Pengantar teknologi: ";cin>>y;
    cout << "Prak. Alpro        : ";cin>>u;
    cout << "Kalkulus           : ";cin>>z;
    cout<<endl<<endl<<endl;

if (q=='a'||q=='A'){
    agama=4*2;
        }else if (q=='b'||q=='B'){
    agama=3*2;
        }else if (q=='c'||q=='C'){
    agama=2*2;
        }else if (q=='d'||q=='D'){
    agama=1*2;
        }else if (q=='e'||q=='E'){
    agama=0*2;
        }else{cout<<"Anda Salah Input Nilai !";}
if (w=='a'||w=='A'){
    pancasila=4*2;
        }else if (w=='b'||w=='B'){
    pancasila=3*2;
        }else if (w=='c'||w=='C'){
    pancasila=2*2;
        }else if (w=='d'||w=='D'){
    pancasila=1*2;
        }else if (w=='e'||w=='E'){
    pancasila=0*2;
        }else{cout<<"Anda Salah Input Nilai !";}
if (r=='a'||r=='A'){
    logma=4*3;
        }else if (r=='b'||r=='B'){
    logma=3*3;
        }else if (r=='c'||r=='C'){
    logma=2*3;
        }else if (r=='d'||r=='D'){
    logma=1*3;
        }else if (r=='e'||r=='E'){
    logma=0*3;
        }else{cout<<"Anda Salah Input Nilai !";}
if (t=='a'||t=='A'){
    alpro=4*3;
        }else if (t=='b'||t=='B'){
    alpro=3*3;
        }else if (t=='c'||t=='C'){
    alpro=2*3;
        }else if (t=='d'||t=='D'){
    alpro=1*3;
        }else if (t=='e'||t=='E'){
    alpro=0*3;
        }else {cout<<"Anda Salah Input Nilai !";}
if (y=='a'||y=='A'){
    pti=4*3;
        }else if (y=='b'||y=='B'){
    pti=3*3;
        }else if (y=='c'||y=='C'){
    pti=2*3;
        }else if (y=='d'||y=='D'){
    pti=1*3;
        }else if (y=='e'||y=='E'){
    pti=0*3;
          }else {cout<<"Anda Salah Input Nilai !";}
if (u=='a'||u=='A'){
    prak=4*1;
        }else if (u=='b'||u=='B'){
    prak=3*1;
        }else if (u=='c'||u=='C'){
    prak=2*1;
        }else if (u=='d'||u=='D'){
    prak=1*1;
        }else if (u=='e'||u=='E'){
    prak=0*1;
        }else {cout<<"Anda Salah Input Nilai !";}
if (z=='a'||z=='A'){
    kalkul=4*4;
        }else if (z=='b'||z=='B'){
    kalkul=3*4;
        }else if (z=='c'||z=='C'){
    kalkul=2*4;
        }else if (z=='d'||z=='D'){
    kalkul=1*4;
        }else if (z=='e'||z=='E'){
    kalkul=0*4;
        }else {cout<<"Anda Salah Input Nilai !";}

totalmk=7;
totalsks=18;
hasil=(agama+pancasila+logma+alpro+pti+prak+kalkul)/totalsks;
cout<<"Nama Mahasiswa yang bernama      : "<<nama<<endl<<endl<<endl;
cout<<"-------------------------------------------------"<<endl;
cout<<"++++++++++++++++PERHITUNGAN IPK++++++++++++++++++"<<endl;
cout<<"-------------------------------------------------"<<endl;
cout<<"Total kalkulasi mata kuliah      : "<<totalmk<<endl;
cout<<"Total jumlah sks yang diambil    : "<<totalsks<<endl;
cout<<"Nilai IPK semester 1             : "<<hasil<<endl;

    return 0;
}



0 komentar:

Posting Komentar