Categories
Pemprogramman C++

Program menghitung nilai dan Grade c++

Kali ini saya akan share contoh program yang sangat sederhana yaitu menghitung nilai filal beserta grade yang di dapatkan menggunakan c++

 #include <iostream>

using namespace std;


main()

{

    cout<<"                              We Are Team 1\n";

    cout<<"                              Informatics Engineering\n";

    cout<<"                              BATCH = 4\n";

    cout<<"________________________________________________________________________________\n";


    int Mid,Final,Assigment, NA;


    cout<<"Input Mid Test Score = \n";

    cin>>Mid;

    //cout<<Mid;


    cout<<"Input Final Test Score = \n";

    cin>>Final;

    //cout<<Final;


    cout<<"Input Assigment Score = \n";

    cin>>Assigment;

    //cout<<Assigment;



    NA = (Mid*0.3) + (Final*0.3) + (Assigment*0.4);

    cout<<"Final Score = "<<NA<<endl;


    if (NA >=65)

    {

    cout<<endl<<"===============================You Pass The Test================================\n";

    }

    else

    {

    cout<<endl<<"===============================You Didn't Pass The Test=========================\n";

    }


    if (NA >=89)

    {

    cout<<"Your Grade Is = A"<<endl<<"Very Good";

    }

    else if (NA >=70)

    {

    cout<<"Your Grade Is = B"<<endl<<"Good";

    }

    else if (NA >=60)

    {

    cout<<"Your Grade Is = C"<<endl<<"Pretty Good";

    }

    else if (NA >=50)

    {

    cout<<"Your Grade Is = D"<<endl<<"Not Good Enough";

    }

    else if (NA >=20)

    {

    cout<<"Your Grade Is = E"<<endl<<"Poorly";

    }

}

Leave a Reply

Your email address will not be published. Required fields are marked *