Program C++ KRS dan KHS

 Kode :

//judul : Input KRS dan KHS

//author : Ryota Irawan

//15 October 2022


#include <iostream>


using namespace std;




//kamus

string mk1,mk2,mk3,mk4;

string nama;

string j1,j2,j3,j4;

string sa1,sa2,sa3,sa4;

string kal1,kal2,kal3,kal4;

string up1,up2,up3,up4;

string fakultas, jenjang, prodi;


//int

int tt1,tt2,tt3,tt4;

float s1,s2,s3,s4;

float p1,p2,p3,p4;


int m1,m2,m3,m4;

float k1,k2,k3,k4;


int as1,as2,as3,as4;

float o1,o2,o3,o4;


int np1,np2,np3,np4;

float a1,a2,a3,a4;


int x1,x2,x3,x4;

float n1,n2,n3,n4;


int b1,b2,b3,b4;

float v1,v2,v3,v4;


int digit2,digit3,nim,thmasuk;





//float

float hasil;

float RataRata1,RataRata2,RataRata3,RataRata4;

//char

char ulang;

char ulang1;

char digit1;



//diskripsi

main ()

{

Awalan:

cout<<"Mendata KRS/KHS Maba Teknologi Informasi"<<endl;

cout<<"||====================================||"<<endl;

cout<<"Masukkan nama mu :";

getline (cin,nama);




cout<<"================="<<endl;


cout<< "Masukkan Mata kuliah 1 :";

getline(cin,mk1);

cout<< "Masukkan SKS Mata kuliah 1 :"; cin >> s1;

cin.ignore();


cout<<"================="<<endl;


cout<< "Masukkan Mata kuliah 2 :";

getline(cin,mk2);

cout<< "Masukkan SKS Mata kuliah 2 :"; cin >> s2;

cin.ignore();


cout<<"================="<<endl;


cout<< "Masukkan Mata kuliah 3 :";

getline(cin,mk3);

cout<< "Masukkan SKS Mata kuliah 3 :"; cin >> s3;

cin.ignore();


cout<<"================="<<endl;


cout<< "Masukkan Mata kuliah 4 :";

getline(cin,mk4);

cout<< "Masukkan SKS Mata kuliah 4 :"; cin >> s4;

cin.ignore();


cout<<"================="<<endl;


cout<<"==================================================="<<endl;

cout<<"                  KARTU HASIL STUDI                "<<endl;

cout<<"           PROGRAM STUDI TEKNIK INFORMATIKA        "<<endl;

cout<<"              UNIVERSITAS DIAN NUSWANTORO          "<<endl;

cout<<"==================================================="<<endl;


cout<<"Nama :" << nama <<endl;


    cout << "Silahkan masukkan NIM anda dibawah ini!\n";

    cout << "Inputkan Digit/Huruf Pertama untuk kode fakultas (A/B/C/D/dst) --> "; cin >> digit1;

    cout << "Inputkan Digit kedua untuk kode jenjang --> "; cin >> digit2;

    cout << "Inputkan Digit ketiga untuk kode prodi --> "; cin >> digit3;

    cout << "Silahkan input tahun masuk anda --> "; cin >> thmasuk;

    cout << "Inputkan 5 Digit terakhir NIM anda --> "; cin >> nim;


    // pendeteksi fakultas

    if (digit1 == 'A') {

        fakultas = "FIK";

        //pendeteksi jenjang

        if (digit2 == 1) {

            jenjang = "S1";

            //pendeteksi prodi

            if (digit3 == 1) {

                prodi = "Teknik Informatika";

            }

            else if (digit3 == 2) {

                prodi = "golek dewe, aku males ngecek prodi";

            }

        }

        else if (digit2 == 2) {

            jenjang = "D3";

            //pendeteksi prodi

            if (digit3 == 1) {

                prodi = "Manajemen Informatika";

            }

            else if (digit3 == 2) {

                prodi = "golek dewe, aku males ngecek prodi";

            }

        }


    }

    else if (digit1 == 'B') {

        fakultas = "FEB";

        //pendeteksi jenjang

        if (digit2 == 1) {

            jenjang = "S1";

            //pendeteksi prodi

            if (digit3 == 1) {

                prodi = "Manajemen";

            }

            else if (digit3 == 2) {

                prodi = "golek dewe, aku males ngecek prodi";

            }

        }

        else if (digit2 == 2) {

            jenjang = "D3";

            //pendeteksi prodi

            if (digit3 == 1) {

                prodi = "Akuntansi";

            }

            else if (digit3 == 2) {

                prodi = "golek dewe, aku males ngecek prodi";

            }

        }


    }



    // Output

    cout << "\nHasil Deskripsi anda akan muncul dibawah ini\n";

    cout << "Nama: " << nama << endl;

    cout << "NIM: " << digit1 << digit2 << digit3 << "." << thmasuk << "." << nim << endl;

    cout << "Fakultas Anda --> " << fakultas << endl;

    cout << "Jenjang anda --> " << jenjang << endl;

    cout << "Prodi anda --> " << prodi << endl;


cout<<"===================================================================="<<endl;

cout<< "Nama Mata Kuliah" <<"     "<< "SKS" << "           "<<endl;

cout<< mk1 << "                     " << s1 << "             "<<endl;

cout<<"===================================================================="<<endl;

cout<< mk2 << "                     " << s2 << "             "<<endl;

cout<<"===================================================================="<<endl;

cout<< mk3 << "                     " << s3 << "             "<<endl;

cout<<"===================================================================="<<endl;

cout<< mk4 << "                     " << s4 << "             "<<endl;

cout<<"===================================================================="<<endl;


cout <<"APAKAH ada KRS yang perlu diinput lagi? (Y/N)? "<<endl;

cin >> ulang;

cout <<endl;


if (ulang=='Y'||ulang=='y')

{

    goto Awalan;

}

if (ulang=='Y'||ulang=='y')

{

    goto ryotairawan;

}




ryotairawan:

cout <<" Inputkan jenis mata kuliah : "<< mk1 <<" (T/P/TP) "<< endl;

cout << "Input :"; cin >> j1;

if(j1=="t"|| j1=="T" || j1=="p" || j1=="p")

{

    cout <<" Masukkan nilai tugas : "<< mk1 << " Kamu " <<endl;

    cout << "Input :"; cin >> tt1;

    cout <<" Masukkan Persetanse nilai tugas " << mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >> p1;



    cout <<" Masukkan nilai mid : "<< mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >> m1;

    cout <<" Masukkan persentase nilai mid " << mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >> k1;


    cout <<" Masukkan nilai UAS : "<< mk1 << "Kamu" << endl;

    cout << "Input :"; cin >>as1;

    cout <<" Masukkan Persentase nilai UAS " << mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >>o1;


RataRata1 = tt1 *(p1/100)+m1* (k1/100)+as1* (o1/100) > 100;

cout << "SKOR anda adalah : "<< RataRata1 <<endl;


}else

    cout <<" Masukkan nilai tugas : "<< mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >> tt1;

    cout <<" Masukkan Persetanse nilai tugas " << mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >> p1;


    cout <<" Masukkan nilai mid : "<< mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >> m1;

    cout <<" Masukkan persentase nilai mid " << mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >> k1;


    cout <<" Masukkan nilai UAS : "<< mk1 << "Kamu" << endl;

    cout << "Input :"; cin >>as1;

    cout <<" Masukkan Persentase nilai UAS " << mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >>o1;


    cout <<" Masukkan nilai Tugas Praktek "<< mk1 << "Kamu" << endl;

    cout << "Input :"; cin >> np1;

    cout <<" Masukkan Persentase Tugas Praktek " << mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >> a1;


    cout <<" Masukkan nilai Mid Praktek : "<< mk1 << "Kamu" << endl;

    cout << "Input :"; cin >> x1;

    cout <<" Masukkan Persentase Mid praktek " << mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >> n1;


    cout <<" Masukkan nilai UAS Praktek : "<< mk1 << "Kamu" << endl;

    cout << "Input :"; cin >> b1;

    cout <<" Masukkan Persentase UAS praktek " << mk1 << "Kamu" <<endl;

    cout << "Input :"; cin >> v1;


RataRata1=(tt1*(p1/100))+(m1*(k1/100))+(as1*(o1/100))+(np1*(a1/100))+(x1*(n1/100))+(b1*(v1/100));

cout << "SKOR anda adalah :" << RataRata1 <<endl;


cout <<" Inputkan jenis mata kuliah : "<< mk2 <<" (T/P/TP) "<< endl;

cout << "Input :"; cin >> j2;

if(j2=="t"|| j2=="T" || j2=="p" || j2=="p")

{

    cout <<" Masukkan nilai tugas : "<< mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> tt2;

    cout <<" Masukkan Persetanse nilai tugas " << mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> p2;



    cout <<" Masukkan nilai mid : "<< mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> m2;

    cout <<" Masukkan persentase nilai mid " << mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> k2;


    cout <<" Masukkan nilai UAS : "<< mk2 << "Kamu" << endl;

    cout << "Input :"; cin >>as2;

    cout <<" Masukkan Persentase nilai UAS " << mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >>o2;


RataRata2 = tt2 * (p2/100) + m2 * (k2/100) + as2* (o1/100);

cout << "SKOR anda adalah :" << RataRata2 <<endl;



}else

    cout <<" Masukkan nilai tugas : "<< mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> tt2;

    cout <<" Masukkan Persetanse nilai tugas " << mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> p2;


    cout <<" Masukkan nilai mid : "<< mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> m2;

    cout <<" Masukkan persentase nilai mid " << mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> k2;


    cout <<" Masukkan nilai UAS : "<< mk2 << "Kamu" << endl;

    cout << "Input :"; cin >>as2;

    cout <<" Masukkan Persentase nilai UAS " << mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >>o2;


    cout <<" Masukkan nilai Tugas Praktek "<< mk2 << "Kamu" << endl;

    cout << "Input :"; cin >> np2;

    cout <<" Masukkan Persentase Tugas Praktek " << mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> a2;


    cout <<" Masukkan nilai Mid Praktek : "<< mk2 << "Kamu" << endl;

    cout << "Input :"; cin >> x2;

    cout <<" Masukkan Persentase Mid praktek " << mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> n2;


    cout <<" Masukkan nilai UAS Praktek : "<< mk2 << "Kamu" << endl;

    cout << "Input :"; cin >> b2;

    cout <<" Masukkan Persentase UAS praktek " << mk2 << "Kamu" <<endl;

    cout << "Input :"; cin >> v2;


RataRata2 = tt2 * (p2/100) + m2 * (k2/100) + as2 * (o2/100) + np2 * (a2/100) + x2 * (n2/100) + b2 * (v2/100);

cout << "SKOR anda adalah :" << RataRata2 <<endl;


cout <<" Inputkan jenis mata kuliah : "<< mk3 <<" (T/P/TP) "<< endl;

cout << "Input :"; cin >> j3;

if(j3=="t"|| j3=="T" || j3=="p" || j3=="p")

{

    cout <<" Masukkan nilai tugas : "<< mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> tt3;

    cout <<" Masukkan Persetanse nilai tugas " << mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> p3;



    cout <<" Masukkan nilai mid : "<< mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> m3;

    cout <<" Masukkan persentase nilai mid " << mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> k3;


    cout <<" Masukkan nilai UAS : "<< mk3 << "Kamu" << endl;

    cout << "Input :"; cin >>as3;

    cout <<" Masukkan Persentase nilai UAS " << mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >>o3;


RataRata3 = tt3 * (p3/100) + m3 * (k3/100) + as3* (o3/100);

cout << "SKOR anda adalah :" << RataRata3 <<endl;


}else

    cout <<" Masukkan nilai tugas : "<< mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> tt3;

    cout <<" Masukkan Persetanse nilai tugas " << mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> p3;


    cout <<" Masukkan nilai mid : "<< mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> m3;

    cout <<" Masukkan persentase nilai mid " << mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> k3;


    cout <<" Masukkan nilai UAS : "<< mk3 << "Kamu" << endl;

    cout << "Input :"; cin >>as3;

    cout <<" Masukkan Persentase nilai UAS " << mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >>o3;


    cout <<" Masukkan nilai Tugas Praktek "<< mk3 << "Kamu" << endl;

    cout << "Input :"; cin >> np3;

    cout <<" Masukkan Persentase Tugas Praktek " << mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> a3;


    cout <<" Masukkan nilai Mid Praktek : "<< mk3 << "Kamu" << endl;

    cout << "Input :"; cin >> x3;

    cout <<" Masukkan Persentase Mid praktek " << mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> n3;


    cout <<" Masukkan nilai UAS Praktek : "<< mk3 << "Kamu" << endl;

    cout << "Input :"; cin >> b3;

    cout <<" Masukkan Persentase UAS praktek " << mk3 << "Kamu" <<endl;

    cout << "Input :"; cin >> v3;


RataRata3 = tt3 * (p3/100) + m3 * (k3/100) + as3 * (o3/100) + np3 * (a3/100) + x3 * (n3/100) + b3 * (v3/100);

cout << "SKOR anda adalah :" << RataRata3 <<endl;


cout <<" Inputkan jenis mata kuliah : "<< mk4 <<" (T/P/TP) "<< endl;

cout << "Input :"; cin >> j4;

if(j4=="t"|| j4=="T" || j4=="p" || j4=="p")

{

    cout <<" Masukkan nilai tugas : "<< mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> tt4;

    cout <<" Masukkan Persetanse nilai tugas " << mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> p4;



    cout <<" Masukkan nilai mid : "<< mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> m4;

    cout <<" Masukkan persentase nilai mid " << mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> k4;


    cout <<" Masukkan nilai UAS : "<< mk4 << "Kamu" << endl;

    cout << "Input :"; cin >>as4;

    cout <<" Masukkan Persentase nilai UAS " << mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >>o4;


RataRata4 = tt4 * (p4/100) + m4 * (k4/100) + as4* (o4/100);

cout << "SKOR anda adalah :" << RataRata4 <<endl;


}else

    cout <<" Masukkan nilai tugas : "<< mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> tt4;

    cout <<" Masukkan Persetanse nilai tugas " << mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> p4;


    cout <<" Masukkan nilai mid : "<< mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> m4;

    cout <<" Masukkan persentase nilai mid " << mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> k4;


    cout <<" Masukkan nilai UAS : "<< mk4 << "Kamu" << endl;

    cout << "Input :"; cin >>as4;

    cout <<" Masukkan Persentase nilai UAS " << mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >>o4;


    cout <<" Masukkan nilai Tugas Praktek "<< mk4 << "Kamu" << endl;

    cout << "Input :"; cin >> np4;

    cout <<" Masukkan Persentase Tugas Praktek " << mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> a4;


    cout <<" Masukkan nilai Mid Praktek : "<< mk4 << "Kamu" << endl;

    cout << "Input :"; cin >> x4;

    cout <<" Masukkan Persentase Mid praktek " << mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> n4;


    cout <<" Masukkan nilai UAS Praktek : "<< mk4 << "Kamu" << endl;

    cout << "Input :"; cin >> b4;

    cout <<" Masukkan Persentase UAS praktek " << mk4 << "Kamu" <<endl;

    cout << "Input :"; cin >> v4;


RataRata4 = tt4 * (p4/100) + m4 * (k4/100) + as4 * (o4/100) + np4 * (a4/100) + x4 * (n4/100) + b4 * (v4/100);

cout << "SKOR anda adalah :" << RataRata4 <<endl;



cout <<"================================================================================================================================================================================================================================"<<endl;

cout <<"                                                                                        NILAI MATA KULIAH T/P/TP                                                                                                                "<<endl;

cout <<"MATA KULIAH" << "TIPE" << " N.Tugas " << " N.Tugas P" << "P.N Tugas" << "P.N Tugas P" << "N.Mid" << "N.Mid P" << "P.N Mid" << "P.N Mid P" << "N.UAS" << "N.UAS P" << "P.N UAS" << "P.N UAS P"                                    <<endl;

cout << mk1 << "    " << j1 << "    " << tt1 << "    " << np1 << "    " << p1 << "    " << a1 << "    " << m1 << "    " << x1 << "    " << k1 << "    " << n1 << "    " << as1 << "    " << b1 << "    " << o1 << "    " << v1 << "    " <<endl;

cout << mk2 << "    " << j2 << "    " << tt2 << "    " << np2 << "    " << p2 << "    " << a2 << "    " << m2 << "    " << x2 << "    " << k2 << "    " << n2 << "    " << as2 << "    " << b2 << "    " << o2 << "    " << v2 << "    " <<endl;

cout << mk3 << "    " << j3 << "    " << tt3 << "    " << np3 << "    " << p3 << "    " << a3 << "    " << m3 << "    " << x3 << "    " << k3 << "    " << n3 << "    " << as3 << "    " << b3 << "    " << o3 << "    " << v3 << "    " <<endl;

cout << mk4 << "    " << j4 << "    " << tt4 << "    " << np4 << "    " << p4 << "    " << a4 << "    " << m4 << "    " << x4 << "    " << k4 << "    " << n4 << "    " << as4 << "    " << b4 << "    " << o4 << "    " << v4 << "    " <<endl;

cout <<"================================================================================================================================================================================================================================"<<endl;


cout << "MATA KULIAH" << " SKOR AKHIR" <<endl;

cout << mk1 << "    " << RataRata1;

cout << mk2 << "    " << RataRata2;

cout << mk3 << "    " << RataRata3;

cout << mk4 << "    " << RataRata4;




cout <<"Apakah ada Data yang akan diinput lagi (Y/N)?"<<endl;

cin >> ulang1;

cin.ignore();


if (ulang1=='Y'||ulang1=='y')

{

    goto Awalan;

}

if (ulang1=='Y'||ulang1=='y')

{

    goto Selesai;

}


Selesai:


    cout<<"PROGRAM SELESAI"<<endl;


}

Hasil :







Comments