Pages

Download Film Fast and Furious 6 (2013) full movie Gratis

Inilah film yang paling fenomenal tahun ini, Fast and Furious 6. Mengapa fenomenal ? Karena salah satu aktornya adalah orang indonesia, Joe Taslim.

50 Kampus Terbaik di Indonesia 2013

Webometrics telah melakukan pemeringkatan kepada seluruh universitas di Indonesia yang telah di akreditasi BAN-PT.

Sinopsis The Hangover Part 3

Film yang merupakan seri / sequel ketiga dari film komedi yang disutradarai Todd Philips ini, akan menjadi seri film terakhir dari Hangover Part III, yaitu The Hangover Part III.

Spesifikasi dan Review Google Glass

Berikut review dan spesifikasi gadget yang banyak jadi bahan pembicaraan banyak orang. "Google Glass"

10 Hal yang Tidak Anda Ketahui tentang Sir Alex Ferguson

Berikut informasi mengenai "10 Hal yang Tidak Anda Ketahui tentang Sir Alex Ferguson"

Sunday, 13 January 2013

Menentukan Grade Berdasarkan Nilai yang diinput

#include <iostream>
#include <conio.h>
#include <iomanip>
#include <string.h>
using namespace std;

void display_data( string, string, float, string);
float nilai_akhir(float , float, float);
float average( float , int );
float maximum( float );
float minimum( float );
string grade( float );
void atas();
void endinput();
void hslkpl();
void kaki();

class hasil                                                        
{
public:
//Display data      
void display_data( string nim1, string nama1, float nilai1, string grading1)
{
     cout<<" "<<nim1<<" \t "<<nama1<<" \t\t "<<nilai1<<" \t\t "<<grading1;
     cout<<endl;             
}
//Laporan akhir
void display_akhir( float total2, float rata, int jumlah, float max1, float min1  )
{
     cout<<endl;
     cout<<"Total Student\t\t: "<<jumlah<<endl;
     cout<<"Total All Value\t\t: "<<total2<<endl;
     cout<<"All Average Value\t: "<<rata<<endl;
     cout<<"Maximum Value\t\t: "<<max1<<endl;
     cout<<"Minimum Value\t\t: "<<min1<<endl;
}    
};


class laporan
{
public:

laporan( string );
void setnama( string );
string getnama();
void setmatkul( string );
string getmatkul();
void setlecture( string );
string getlecture();
void setsmester( int );
int getsmester();
void msgg();
void msggtable();
string msggmatkul();
string msgglecture();
int msggsmester();
void input_data();

private:
string matkul;
string lecture;
string namaset;
int smester;      
};

laporan::laporan( string name )
{
     setmatkul( name );
     setlecture( name );
     setnama( name );
}
//proses set modul
void laporan::setmatkul( string name )
{
     matkul = name;  
}
void laporan::setlecture( string name )
{
     lecture = name;
}
void laporan::setnama( string name )
{
     namaset = name;
}
void laporan::setsmester( int angka )
{
     smester = angka;
}
//*************************** GET MODUL **************************************//
string laporan::getmatkul()
{
       cout<<"Class        : "<<matkul;
       getline( cin, matkul );
       return matkul;
}
string laporan::getlecture()
{
       cout<<"Lecture Name : "<<lecture;
       getline( cin, lecture );
       return lecture;
}
string laporan::getnama()
{
       cout << "Student Name : "<<namaset;
       getline( cin, namaset );
       return namaset;
}
int laporan::getsmester()
{
       cout<<"Semester     : ";
       cin>>smester;
       return smester;
}
void laporan::msgg()
{
     getmatkul();
     getlecture();
     getsmester();
     cout<<endl;  
}


string laporan::msggmatkul()
{
       cout<<"Class\t\t: "<<matkul;
       return matkul; 
}
string laporan::msgglecture()
{
       cout<<"Lecture Name\t: "<<lecture;
       return lecture;
}
int laporan::msggsmester()
{
    cout<<"Semester\t: "<<smester;
    return smester;
}

void laporan::msggtable()
{
     msggmatkul();
     cout<<endl;
     msgglecture();
     cout<<endl;
     msggsmester();
     cout<<endl;
}
 

void laporan::input_data()
{
     string nama[60];
     string nim[60];
     string grade1[60];
     string batas;
     float uts[60],uas[60],tugas[60];
     float nilai_akhir1[60];
     float total;
     float average1;
     float max;
     float min;
     float asa;
    
     int i=1;
     int count=0;
     hasil yudi;//memanggil class dengan membuat variabel baru yudi

     do
     {
         cout << "Student Data ["<<i<<"] : \n"<<endl;
        
         cout << "ID"<<setw(13)<<": ";
         cin  >> nim[i];
        
         if ( nim[i] != "xxx" )
         {
            cout << "Student Name"<<setw(2)<<" : ";
            cin  >> nama[i];
            cout << "Mid Ex."<<setw(8)<<" : ";
            cin  >> uts[i];
            if ( uts[i] > 100 || uts[i] < 0 )
            {
               do
               {
                 cout << "Mid Ex."<<setw(14)<<" : ";
                 cin  >> uts[i];
                 asa = uts[i];
               }
               while( asa > 100 || asa < 0 ); 
            }
            cout << "End Ex."<<setw(8)<<" : ";
            cin  >> uas[i];
            if ( uas[i] > 100 || uas[i] < 0 )
            {
               do
               {
                 cout << "End Ex."<<setw(14)<<" : ";
                 cin  >> uas[i];
                 asa = uas[i];
               }
               while( asa > 100 || asa < 0 );
            }
            cout << "Lesson"<<setw(9)<<" : ";
            cin  >> tugas[i];
            if ( tugas[i] > 100 || tugas[i] < 0 )
            {
               do
               {
                 cout << "Lesson"<<setw(12)<<" : ";
                 cin  >> tugas[i];
                 asa = tugas[i];
               }
               while( asa > 100 || asa < 0 );
            }
           
            i++;
            count++;
            cout<<endl;
          }
     batas = nim[i];
     }
     while( batas != "xxx" );
    
     endinput();
     msggtable();
     hslkpl();

     if ( nim[1] != "xxx" )
     {
        for (i=1; i <= count; i++)
        {   
             nilai_akhir1[i] = nilai_akhir(uts[i], uas[i], tugas[i]) ;
             grade1[i] = grade(nilai_akhir1[i]);
             max = maximum( nilai_akhir1[i] );
             min = minimum( nilai_akhir1[i] );
             total += nilai_akhir1[i];           
             yudi.display_data(nim[i], nama[i], nilai_akhir1[i], grade1[i]);//MEMANGGIL FUNGSI DISPLAY_DATA
             cout<<endl;
             average1 = average( total, count );
        }
     }
     if ( nim[1] == "xxx" )
     {
          average1 = 0;
          total = 0;
          count = 0;
          cout<<endl;
     }
     kaki();
     yudi.display_akhir( total, average1, count, max, min );
}

//cari max
float temp = 0;
float maximum( float nilai )
{
     float maximum;
     if( nilai > temp )
     {
         temp = nilai;
         maximum = nilai;
         return (maximum);
     }
     else
     maximum = temp;
     return (maximum);
}
//cari min
float temp1 = 100;
float minimum( float nilai )
{
      float minimum;
      if( nilai <= temp1 )
      {
          temp1 = nilai;
          minimum = nilai;
          return (minimum);
      }
      else
      minimum = temp1;
      return (minimum);
}    

float nilai_akhir(float uts1,float uas1,float tugas1 )
{
      float nilai_akhir;
      nilai_akhir = (uts1*0.2) + (uas1*0.3) + (tugas1*0.5);
      return(nilai_akhir);
}
float average( float total1, int jumlah )
{
      float rata_rata;
      rata_rata = total1 / (jumlah);
      return( rata_rata );     
}
///grading di mulai :D
string grade( float nilai_a )
{
      string grade;
      if ( nilai_a <= 100 && nilai_a >= 80 )
      {
           grade = "A";
           return(grade);
      }
      else if( nilai_a < 80 && nilai_a >= 70 )
      {
           grade = "B";
           return(grade);
      }
      else if( nilai_a < 70 && nilai_a >= 60 )
      {
           grade = "C";
           return(grade);
      }
      else if( nilai_a < 60 && nilai_a >= 50 )
      {
           grade = "D";
           return(grade);
      }
      else if( nilai_a < 50 )
      {
           grade = "E";
           return(grade);
      }
}


void atas()
{
     cout<<"A Program By W.E.S"<<endl<<endl;
     cout<<"=================================================================="<<endl;
     cout<<"                         STUDENT DATA                          "<<endl;
     cout<<"=================================================================="<<endl;
}

void endinput()
{
     cout<<"\n\n";
     cout<<"=================================================================="<<endl;
     cout<<"\n";
     cout<<"                          STUDENT DATA REPORT                       "<<endl;
     cout<<"\n";
}

void hslkpl()
{
    
     cout<<"------------------------------------------------------------------"<<endl;
     cout<<" ID \t\t| Student Name | Result Value   |\t GRADE \t  |"<<endl;
     cout<<"------------------------------------------------------------------"<<endl;
     cout<<"\n";
}

void kaki()
{
     cout<<"------------------------------------------------------------------"<<endl;
}
//============================================================================//
int main()//MAIN LINE
{
    atas();
    cout<<endl;
    laporan mylaporan("");
    mylaporan.msgg();
    mylaporan.input_data();
    cout<<"\n\n------------------------------------------------------------------"<<endl;
    cout<<"\t\tThanks for use our Program";
    cout<<"\n------------------------------------------------------------------"<<endl;
    getch();
}
Written by: Wahyudi Nugroho
WN UPDATE, Updated at: 01:19