2010-11-27

program C++ IP(indeks prestasi)

IP(indeks prestasi) buat rekan2 yang ingin tahu gmna sh cra penghitungan indeks mahasiswa tu gmna ini ni pogrm nya,program penghitungan IP buat mahasiswa,,,cara nya sih lumayan panjang y tp y gtu lah klu mo tau  bagaimana prosedur penghitungan indeks prestasi mahasiswa

sya ucap kan SELAMAT MENCOBA!!!! (;


#include<stdio.h>

#include<conio.h>
#include<iostream.h>
int main()
{
    int total[8],nilai[3][8],i,j,sks[8],mhs[4],ip[4];
    char indeks[5],nilaipel[8][8];
    indeks[1]='A';
    indeks[2]='B';
    indeks[3]='C';
    indeks[4]='D';
    indeks[5]='E';
    i=1;
    while(i<=7)
    {
      cout<<"sks pelajaran ke-"<<i<<"=";
      cin>>sks[i];
      i++;
    }
    i=1;
    while(i<=3)
    {
      cout<<"mahasiswa ke-"<<i;
      cin>>mhs[i];
     j=1;
     while(j<=7)
     {
      cout<<"nilai pelajaran"<<j<<"=";
      cin>>nilaipel[i][j];
      j++;                 
     }
     i++;
     }
     i=1;
     while(i<=3)
     {
       j=1;
       while(j<=7)
       {
         if(nilaipel[i][j]==indeks[1])
         {
           nilai[i][j]=4;
         }
         else
         {
          if(nilaipel[i][j]==indeks[2])
          {
            nilai[i][j]=3;
            }
            else
            {
             if(nilaipel[i][j]==indeks[3])
             {
               nilai[i][j];                         
                }
                else
                {
                    if(nilaipel[i][j]==indeks[4])
                    {
                      nilai[i][j];
                      }
                      else
                      {
                        if(nilaipel[i][j]==indeks[5])
                        {
                            nilai[i][j];
                         }
                          }
                          }                         
                          }
                          }
                          j++;
                          } 
                          i++;                
                           }
                           i=1;
                           total[i]=0;
                        while(i<=7)
                        {
                          total[i]=total[i]+sks[i];
                          i++;
                          }
                            i=1;
                           while(i<=3)
                           {
                            ip[i]=0;        
                            j=1;
                            while(j<=7)
                            {
                             ip[i]=ip[i]+(sks[j]*nilai[i][j]);
                             j++;
                             }
                             ip[i]=ip[i]/total[i];        
                             i++;
                             }
                            i=1;
                            while(i<=3)
                            {
                              cout<<"indeks prestasi mahasiswa ke-"<<i<<ip[i];
                              i++;
                              }
                            getch();
     }




0 komentar:

Posting Komentar

Diberdayakan oleh Blogger.
Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Powered by Blogger