C++ Grading

//lh3.googleusercontent.com/-K5UKWzgJhmU/AAAAAAAAAAI/AAAAAAAACdI/CN3nwiBZsGE/s512-c/photo.jpg
November 26, 2016




gambar disamping adalah tampilan kedua setelah anda memasukkan nama, nim dan nilai anda dan hasilnya akan keluar seperti gambar disamping.

#include <iostream>
#include <conio.h>
#include <stdlib.h>
#include <stdio.h>

using namespace std;
    int main ()
{

int TotalTugas,Tugas,MID,TotalMID,UAS,TotalUAS,TotalNilai;
char*Status;
char NIM[10],Nama[20];
char choice (2);

menu:

cout<<"***Menghitung Nilai Mahasiswa ***"<<endl<<endl;

cout<<"\t\tMasukan NIM                    = ";
cin>>NIM;
cout<<"\t\tMasukkan Nama Mahasiswa        = ";
cin>>Nama;
cout<<"\t\tMasukan Nilai Tugas\t\t        = ";
cin>>Tugas;
cout<<"\t\tMasukan Nilai MID\t            = ";
cin>>MID;
cout<<"\t\tMasukan Nilai UAS\t            = ";
cin>>UAS;
cout<<endl;

system("cls");

cout<<"NIM              = "<<NIM<<endl;
cout<<"Nama Mahasiswa   = "<<Nama<<endl;
cout<<"*************************** Hasil Penilaian Adalah **************************"<<endl<<endl;
TotalTugas=Tugas*25/100;
TotalMID=MID*35/100;
TotalUAS=UAS*40/100;
TotalNilai=TotalTugas+TotalMID+TotalUAS;

if (TotalNilai >=80)
    {cout<<"\t\t------------ Selamat Grade Anda A ------------ \n"<<endl;
            Status="LULUS";
    }

else if (TotalNilai >=70)
    {cout<<"\t\t------------ Selamat Grade Anda B ------------- \n"<<endl;


            Status="LULUS";
    }
else if (TotalNilai >=60)
    {cout<<"\t\t------------ Selamat Grade Anda C ------------- \n"<<endl;


            Status="LULUS";
    }
else if (TotalNilai >=50)
    {cout<<"\t\t------------ Selamat Grade Anda D ------------- \n"<<endl;


            Status="TIDAK LULUS";
    }
else if (TotalNilai <50)
    {cout<<"\t\t------------ Selamat Grade Anda D ------------- \n"<<endl;


            Status="TIDAK LULUS";
    }


cout<<Status<<endl;
cout<<"********************************** Selesai **********************************"<<endl;

cout<<"Back to Menu? [Y / N]: "<<endl;
        cin>>choice;

        if(choice == 'y')
        {
            goto menu;
        }
        else
        {
            system("cls");

        }

getch ();
}


Related Post

SUBSCRIBE TO OUR NEWSLETTER

closed