Navigation
 Index
 Memberlist
 Profile
 FAQ
 Search
Latest topics
» Perkhidmatan Kereta Sewa Shah Alam
Wed Sep 09, 2015 2:48 am by sksportcar

» Homestay Di Kota Bharu
Sun Jan 25, 2015 10:52 pm by sksportcar

» Kereta Sewa Shah Alam
Tue Aug 05, 2014 8:54 am by sksportcar

» Bahasa Jepun: Ayat Seharian,Hari,Haribulan & Nombor
Mon Sep 23, 2013 8:43 pm by foxfoxer

» Tips nak hapuskan virus secara manual [On updates]
Tue Mar 19, 2013 8:38 am by Optitech

» Teknik defense dari virus and spyware [Auto]
Thu Jul 21, 2011 2:53 am by Optitech

» Virus shortcut kat pendrive
Thu Jul 21, 2011 12:27 am by Optitech

» Admin Kembali dengan Menyengat
Wed Jul 20, 2011 1:59 pm by Optitech

» Xcode Magazine - Penulisan daripada hacker
Wed Jul 20, 2011 12:45 pm by Optitech


Final Project List 2/2009

View previous topic View next topic Go down

Final Project List 2/2009

Post  Optitech on Fri Jan 15, 2010 12:02 pm

Berikut merupakan source code asal final project bagi TKK sem 2 tahun 2009.
Anda boleh jadikan source code dibawah sebagai rujukan.

Electricity Usage and Charge Calculator
Credit to Sufri, Yazid, Zakaria

Code:
#include
using namespace std;

class TNB
{
public:
double watt, kwh;
double sum_kwh, Rm_hour, Rm_total;
double num, masa, hari;
double jum_kwh,jum_watt,Rm_sum, sum_watt;

void PAUSE()
{
system("PAUSE");
}


void display()
{
cout<<" ===================================================================="<
cout<<" =\t\t\t\t\t\t\t\t\t=\n";
cout<<" = \t\t SENARAI PERALATAN ELEKTRIK DIDALAM RUMAH\t\t="<
cout<<" =\t\t\t\t\t\t\t\t\t=\n";
cout<<" = ******NO*******\t*****BARANGAN*****\t*****WATT*****\t\t="<
cout<<" =\t\t\t\t\t\t\t\t\t=\n";
cout<<" = \t 1\t\tKomputer Riba \t\t 50 watt\t\t="<
cout<<" = \t 2\t\tPeti Sejuk \t\t 725 watt\t\t="<
cout<<" = \t 3\t\tPemanas Air \t\t 1200 watt\t\t="<
cout<<" = \t 4\t\tRadio \t\t\t 400 watt\t\t="<
cout<<" = \t 5\t\tTelevisyen \t\t 110 watt\t\t="<
cout<<" = \t 6\t\tKipas Siling \t\t 120 watt\t\t="<
cout<<" = \t 7\t\tSeterika \t\t 1300 watt\t\t="<
cout<<" = \t 8\t\tPemain DVD \t\t 25 watt\t\t="<
cout<<" =\t\t\t\t\t\t\t\t\t=\n";
cout<<" ===================================================================="<
cout<
}
};

class kira : public TNB
{

public:

inline void calculation()
{

if (jum_kwh<=400)
{
if(jum_kwh<=200)
{
Rm_hour=sum_kwh*0.218;
Rm_total=Rm_hour*hari;
jum_kwh=jum_kwh sum_kwh;
Rm_sum=Rm_sum Rm_hour;
jum_watt=jum_watt sum_watt;
}

else if (jum_kwh>200 && jum_kwh<=400)
{
Rm_hour=(200*0.218) ((sum_kwh-200)*0.334);
Rm_total=Rm_hour*hari;
jum_kwh=jum_kwh sum_kwh;
Rm_sum=Rm_sum Rm_hour;
}
}

else if(jum_kwh>400)
{
if(jum_kwh<=500)
{
Rm_hour=sum_kwh*0.286;
Rm_total=Rm_hour*hari;
jum_kwh=jum_kwh sum_kwh;
Rm_sum=Rm_sum Rm_hour;
}

else if(jum_kwh>500 && jum_kwh<=600)
{
Rm_hour=(500*0.286) ((jum_kwh-500)*0.378);
Rm_total=Rm_hour*hari;
jum_kwh=jum_kwh sum_kwh;
Rm_sum=Rm_sum Rm_hour;
}

else if(jum_kwh>600 && jum_kwh<=700)
{
Rm_hour=(500*0.286) (99*0.378) ((jum_kwh-500-99)*0.387);
Rm_total=Rm_hour*hari;
jum_kwh=jum_kwh sum_kwh;
Rm_sum=Rm_sum Rm_hour;
}

else if(jum_kwh>700 && jum_kwh<=800)
{
Rm_hour=(500*0.286) (99*0.378) (99*0.387) ((jum_kwh-500-99-99)*0.397);
Rm_total=Rm_hour*hari;
jum_kwh=jum_kwh sum_kwh;
Rm_sum=Rm_sum Rm_hour;
}


else if(jum_kwh>800 && jum_kwh<=900)
{
Rm_hour=(500*0.286) (99*0.378) (99*0.387) (99*0.397) ((jum_kwh-500-99-99-99)*0.417);
Rm_total=Rm_hour*hari;
jum_kwh=jum_kwh sum_kwh;
Rm_sum=Rm_sum Rm_hour;
}

else
{
Rm_hour=(500*0.286) (99*0.378) (99*0.387) (99*0.397) (99*0.417) ((jum_kwh-500-99-99-99-99)*0.446);
Rm_total=Rm_hour*hari;
jum_kwh=jum_kwh sum_kwh;
Rm_sum=Rm_sum Rm_hour;
}}

}
};


int main()
{

kira calculate;
int pilihan;
calculate.display();

do
{
do
{
system("cls");
calculate.display();
cout<<"\n\t\t\tEXIT From The Program [0]"<
cout<<"\nInsert Numbers:";
cin>>calculate.num;

if (calculate.num>=1 && calculate.num<= 8 )
{

cout<<"Insert Hours :";
cin>>calculate.masa;

cout<<"Insert Days :";
cin>>calculate.hari;
cout<<"\n\n";

if (calculate.num==1)
{
calculate.sum_kwh=(50*calculate.masa)/1000;
calculate.sum_watt=(50*calculate.masa);
calculate.calculation();
}

else if (calculate.num==2)
{
calculate.sum_kwh=(725*calculate.masa)/1000;
calculate.sum_watt=(725*calculate.masa);
calculate.calculation();
}

else if (calculate.num==3)
{
calculate.sum_kwh=(1200*calculate.masa)/1000;
calculate.sum_watt=(1200*calculate.masa);
calculate.calculation();
}

else if (calculate.num==4)
{
calculate.sum_kwh=(400*calculate.masa)/1000;
calculate.sum_watt=(400*calculate.masa);
calculate.calculation();
}


else if (calculate.num==5)
{
calculate.sum_kwh=(110*calculate.masa)/1000;
calculate.sum_watt=(110*calculate.masa);
calculate.calculation();
}

else if (calculate.num==6)
{
calculate.sum_kwh=(120*calculate.masa)/1000;
calculate.sum_watt=(120*calculate.masa);
calculate.calculation();
}

else if (calculate.num==7)
{
calculate.sum_kwh=(1300*calculate.masa)/1000;
calculate.sum_watt=(1300*calculate.masa);
calculate.calculation();
}

else if (calculate.num== 8 )
{
calculate.sum_kwh=(25*calculate.masa)/1000;
calculate.sum_watt=(25*calculate.masa);
calculate.calculation();
}
}

else if (calculate.num==0)
return 0;

else
cout<<"\nMAAF,Tiada Dalam Pilihan\n\n";
system("pause");

}while(calculate.num> 8 );

cout<<"\n 1 -- CONTINUE TO INSERT ELECTRICAL ITEMS ";
cout<<"\n 2 -- OUT by DISPLAY WATT AND PRICE NUMBER TO BE PAID "<
cout<<"\n -- Your Choice: ";
cin>>pilihan;

pilihan ;
}

while(pilihan<3);

cout<<"\n\n\t\tWATT :"<<
cout<<"\t\tKWH :"<<<"KWH"<
cout<<"\t\tJUMLAH :RM"<<<"\n\n";

system("pause");
return 0;


}



Interest Calculation
Credit to Munie, Azam, Hanief


Code:

#include
#include
#include
using namespace std;

//base class..
class interest
{
public:
int x, y, z;

public:
interest(); //constructor..

double rate, loan;
int time, user;
void nilai(double x, int y, double z); //declaration inline..

virtual void message(void)
{
cout <<"\n *******************************\n";
cout <<" * THE INTEREST CALCULATIONS *\n";
cout <<" *******************************\n\n";
cout <<" SILA PILIH JENIS BAYARAN:\n";
cout <<"\n 1.Tahunan\n 2.Bulanan\n 3.Harian";
cout <<"\n\n Masukkan no pilihan anda: ";
cin >>user;
cout <<" ********************************";
}
};

//implement interest constructor..
interest::interest()
{
x = y = z = 0;
}

//inline statements..
inline void interest::nilai(double x, int y, double z)
{
loan = x;
time = y;
rate = z;
}

//derived class..
class calInterest:public interest
{
public:
double kira(int user)
{
if (user==1)
return (loan * rate * time)/100;

else if (user==2)
return (loan * rate * time /12)/100;

else if (user==3)
return (loan * rate * time /365)/100;
}

double kiraCom(int user)
{
return loan* pow(1 + rate/100,time);
}

void tunjuklah()
{
double x, z;
cout <<"\n\n Masukkan jumlah pinjaman:RM";
cin >> x;
cout << "\n Kadar peratusan(%): ";
cin >> z;
cout << "\n Tempoh bayaran: ";
cin >> y;
nilai(x, y, z);
cout <<"\n ********************************";
cout <<"\n Interest ialah RM "<
cout <<"\n ********************************";
cout <<"\n Compound ialah RM "<
cout <<"\n ********************************\n\n";
}
};


int main()
{
string d;
string t = "tidak";

//do statements..
do
{
calInterest *tajuk; //declare pointed object
tajuk=new calInterest; //create memory for class calInterest
tajuk->message(); //object access to message()
tajuk->tunjuklah(); //object access to display()
delete tajuk; //delete memory created on tajuk

cout <<" Mau cuba lagi!!!!!.....\n";
cout <<" ****************************************************\n";
cout <<" Taip 'ya' untuk teruskan atau 'tidak' untuk berhenti: ";
cin >> d;
cout <<
}

//while statements..
while (d!= t); //if true the program will be return..if not the program will close..
{
cout <<" Terima kasih kerana mencubanya!!....\n\n";
}

system("pause");
return 0;
}


Studies Loan Calculator
Credit to Lutfi, Firdaus, Amira

Code:

#include <iostream>
#include <iomanip>
#include <math.h>
#include <string>
#include <conio.h>
#include <windows.h>

using namespace std;
//base class
class loan
{
      protected:
                double payment,rate,interest;
                double amount,principle,tAmount;
                int term,counter,check;
         
      public:
         
            int tTerm,setTableM,setTableY;
            int pilih,pilihT;
            void input();
            void display();
            void panduan();
            void about();
         
            void set()
            {
                  tTerm=1;
                  setTableM=20;
                  setTableY=1;
                  pilih=1;
                  }         
};
//derived class from class loan
class disLoan : public loan
{
      public:
            inline void calOther();
            inline void pTableY();
            inline void pTableM();
            double calPayment();
            void setting();
      };

//input data
void loan::input()
{
    cout<<"\nMasukkan Jumlah Pinjaman: RM";
    cin>>amount;
    tAmount=amount;//save amount to temporary memory
    cout<<"Masukkan Kadar Kos Pentadbiran (%):";
    cin>>rate;
    rate=(rate/100);//change to %
    cout<<"Masukkan Tempoh Bayaran:";
    cin>>term;
    }

//calculate payment
double disLoan::calPayment()
{
      //calculate year input payment
      if (tTerm==1)
              payment = (amount * pow((rate / 12) + 1, (term * 12))* rate / 12)/(pow(rate / 12 + 1, (term * 12)) - 1);
      //calculate month input payment
      else if (tTerm==2)
              payment = (amount * pow((rate / 12) + 1, term)* rate / 12)/(pow(rate / 12 + 1, term) - 1);
   
      return payment;
      }

//display basic payment
void loan::display()
{
    system("cls");
    //set to 2 decimal places
    cout << setiosflags(ios::fixed | ios::showpoint) << setprecision(2);
    cout<<"Jumlah Pinjaman: RM"<<tAmount; //display amount
    cout<<"\nTempoh Bayaran: "<<term; //display term of payment
    if (tTerm==1)
    cout<<" Tahun"; //display if term in year
    else if (tTerm==2)
    cout<<" Bulan"; //display  if term in month
    cout<<"\nJumlah Bayaran Bulanan: RM"<<payment<<endl<<endl; //display payment
    }

//calculate interest, principle,new amount
inline void disLoan::calOther()
{
    counter++;
    //initialize amount to 0 when check=0
    if (check==0)
    {
        amount=0;
        }
    interest=(amount * rate)/12;
    //calculate amount
    amount=(amount-payment)+interest;
    //calculate principle
    principle=payment-interest;
    }

//print payment table for month
inline void disLoan::pTableM()
{
    amount=tAmount;
    check=(int)amount;
    counter=0;
    int tCounter=0;
    //table header
    cout<<"Bulan\tBayaran\t\tFaedah\tPrinsip\tBaki Pinjaman" << endl;
    cout<<setfill('-') << setw(80) << "-" << endl;
    while(check !=0)
    {
          tCounter++;
          calOther();
          check=(int)amount;
          if (check==0)
              amount=0;
          //table data
          cout<<counter<<"\t"<<payment<<"\t\t"<<interest<<"\t"<<principle<<"\t"<<amount<<endl;
          if (tCounter==setTableM && amount!=0)
          {
              cout<<"\nPress Enter to Continue";
              tCounter=0;
              getch();
              system("cls");
              //table header
              cout<<"Bulan\tBayaran\t\tFaedah\tPrinsip\tBaki Pinjaman" << endl;
              cout<<setfill('-') << setw(80) << "-" << endl;
           
              }
    }
    cout<<"\n1. Papar semula\n";
    cout<<"2. Menu Utama\n";
    cout<<"3. Keluar\n";
    do {
    try{
        cout<<"Pilihan: ";
        cin>>pilihT;
        //if want to display payment table again
        if (pilihT==1)
        {
            display();
            pTableM();
            }
        //return to main menu(main function)
        else if (pilihT==2)
            return;
        //exit program
        else if (pilihT==3)
            pilih=5;
        else
            throw pilihT;
    }//close try
    catch (int b)
    {
          if (b>3 || b<1)
              cout<<"Masukkan Salah\n"; //exception message
          Sleep(1000);
    }
    }while (pilihT>3 || pilihT<1);
}

//print payment table for year
inline void disLoan::pTableY()
{
    amount=tAmount;
    check=(int)amount;
    int Tyear=0;
    for (int year=1;year<=term;year++)
    {
        counter=0;
        //table header
        cout<<"Tahun "<<year<<endl;
        cout<<"Bulan\tBayaran\t\tFaedah\tPrinsip\tBaki Pinjaman" << endl;
        cout<<setfill('-') << setw(80) << "-" << endl;
        while(check !=0)
        {
              calOther();
              check=(int)amount;
              if (check==0)
                  amount=0;
              //table data
              cout<<counter<<"\t"<<payment<<"\t\t"<<interest<<"\t"<<principle<<"\t"<<amount<<endl;
           
              if (counter == 12 && check!=0)
              {
                  Tyear++;
                  if(Tyear==setTableY)
                  {
                  cout<<"\nPress Enter to Continue";
                  Tyear=0;
                  getch();
                  system("cls");
                  }
                  cout<<endl;
                  break;
              }
        }
    }
    cout<<"\n1. Papar semula\n";
    cout<<"2. Menu Utama\n";
    cout<<"3. Keluar\n";
    do {
    try{
        cout<<"Pilihan: ";
        cin>>pilihT;
        //if want to display payment table again
        if (pilihT==1)
        {
            display();
            pTableY();
            }
        //return to main menu(main function)
        else if (pilihT==2)
            return;
        //exit program
        else if (pilihT==3)
            pilih=5;
        else
            throw pilihT;
    }//close try
    catch (int b)
    {
          if (b>3 || b<1)
              cout<<"Masukkan Salah\n"; //exception message
          Sleep(1000);
    }
    }while (pilihT>3 || pilihT<1);
}

void disLoan::setting()
{
    int temp[2],set;
    char save,tSave;
 
    cout<<"\n1.Tahun\n";
    cout<<"2.Bulan\n";
    cout<<"Jenis Tempoh Bayaran:";
    cin>>set;
    if (set==1)
    {
          cout<<"Jumlah Paparan Jadual:";
          cin>>temp[0];
          }
    else if (set==2)
    {
          cout<<"Jumlah Paparan Jadual:";
          cin>>temp[1];
          }
    do
    {
    cout<<"Simpan Tetapan ( Y / T ):";
    cin>>save;
    save=toupper(save);//change to upper case
    tSave=save;//save data to temporary memory
    try{
        //save the setting
        if (save=='Y')
        {
            tTerm=set;
            if (set==1)
            {
              setTableY=temp[0];
            }
            else if (set==2)
            {
              setTableM=temp[1];
            }
            cout<<"Tetapan Disimpan";
            Sleep(1000);
            break;//out from loop
        }
        else if (save=='T')
        {
            cout<<"Tetapan Tidak Disimpan";
            Sleep(1000);
            break;//out from loop
        }
        else
        {
            throw tSave;
        }
    }//close try
    catch (char a)
    {
          if (a != 'Y' || a != 'T')
          cout<<"Masukkan Salah\n"; //exception message
    }
    }while(save!='Y'||save!='T');
}

//display about the program
void loan::about()
{
    system("cls");
    cout<<"\n        Kalkulator Pinjaman v2.4\n";
    cout<<"\n    Institut Teknikal Jepun-Malaysia\n";
    cout<<" Jabatan Teknologi Kejuruteraan Komputer\n";
    cout<<"-----------------------------------------\n";
    cout<<"\nAhli Kumpulan:";
    cout<<"\n\tMohammad Lutfi Haris\n";
    cout<<"\tMohammad Firdaus Syafik Jefridin\n";
    cout<<"\tNur Amira Abd Rasid\n";
    cout<<"\nTarikh:";
    cout<<"\n7/12/2009\n";
    getch();
    }

//display manual user
void loan::panduan()
{
    system("cls");
    cout<<"\nPanduan Penggunaan"
    <<"\n\nProgram ini adalah untuk kegunaan penuntut-penuntut IPT yang melakukan pinjaman pembelajaran"
    <<" dari Tabung Pembangunan Kemahiran (TPK) untuk mengira jumlah \npembayaran yang akan dilakukan "
    <<"setelah tamat pengajian di IPT.Selain itu, semua penuntut dapat melihat jadual pembayaran yang disediakan "
    <<"dan mengetahui baki \npinjaman setelah pembayaran dibuat.\n"
    <<"\nUntuk menggunakan program ini anda perlu memilihan antara 5 pilihan.\n";
    cout<<"  1. Kalkulator\n";
    cout<<"  2. Tetapan\n";
    cout<<"  3. Panduan Penggunaan\n";
    cout<<"  4. Info Program\n";
    cout<<"  5. Keluar\n";
    cout<<"\nJika anda memilih pilihan 1, anda telah memilih untuk melakukan pengiraan \npinjaman anda. Anda akan diminta"
    <<" supaya memasukkan jumlah pinjaman, kadar kos \npentadbiran dan tempoh pembayaran. Jika anda menetapkan tetapan, "
    <<"tempoh \npembayaran adalah mengikut tahun. Jika anda telah menetapkan tetapan sila \nmasukkan tempoh pembayaran "
    <<"mengikut pilihan yang telah anda lakukan. Setelah \nmemasukkan tempoh pembayaran, program akan secara automatik akan"
    <<" melakukan \npengiraan dan memaparkan jadual pembayaran anda. Anda boleh memaparkan semula \njadual pembayaran anda "
    <<"dengan beberapa pilihan seterusnya.\n"
    <<"\nJika anda memilih pilihan 2, anda akan memasuki bahagian tetapan. Anda boleh \nmelakukan beberapa tetapan mengikut "
    <<"kesesuaian anda. Semasa memasuki bahagian \ntetapan anda diminta untuk memilih jenis tempoh pembayaran sama ada bulan "
    <<"atau \ntahun. Setelah memilih jenis tempoh pembayaran, anda diminta untuk memasukkan \nnilai paparan jadual yang akan "
    <<"dipaparkan iaitu jika pilihan anda adalah 'tahun'anda perlu memasukkan nilai paparan jadual pada satu masa dan jika "
    <<"pilihan anda adalah bulan pula, anda perlu memasukkan nilai jumlah paparan jadual yang akan \ndipaparkan pada satu masa."
    <<"Setelah selesai, anda perlu menyimpan tetapan tersebutdengan memilih anda 'Y' atau 'T'.\n"
    <<"\nJika pilihan anda adalah 3 pula, ia akan memaparkan panduan penggunaan seperti \nmana yang sedang dipaparkan sekarang ini."
    <<"Jika anda memilih pilihan 4, anda akan melihat info program iaitu versi, kumpulan pencipta, tarikh dicipta dan nama \nprogram"
    <<"\n\nUntuk keluar daripada meneruskan program anda boleh memilih pilihan 5 iaitu \npilihan 'Keluar'.";
    getch();
    } 

//main function
int main()
{
    //set color background and font
    system("color F0");
 
    disLoan tpk;//create object
    tpk.set();//set initialize value
 
    while(tpk.pilih!=5)
    {
        try{
        system("cls");
        cout<<"Kalkulator Pinjaman\n";
        cout<<"Tabung Pembangunan Kemahiran (TPK)\n";
        cout<<setfill('-') << setw(80) << "-" << endl;
        cout<<"1. Kalkulator\n";
        cout<<"2. Tetapan\n";
        cout<<"3. Panduan Penggunaan\n";
        cout<<"4. Info Program\n";
        cout<<"5. Keluar\n";
        cout<<"\nSila masukkan pilihan anda:";
        cin>>tpk.pilih;
        //start calculator
        if (tpk.pilih==1)
        {
            tpk.input();
            tpk.calPayment();
            //dispaly first payment table
            tpk.display();
            if (tpk.tTerm==1)
            tpk.pTableY();
            else if (tpk.tTerm==2)
            tpk.pTableM();
         
        }
        //enter setting (by default tTerm=1 setTableY=1 setTableM=20
        else if (tpk.pilih==2)
        {
            tpk.setting();
        }
        //display manual user
        else if (tpk.pilih==3)
        {
            tpk.panduan();
            }
        //display about the program
        else if (tpk.pilih==4)
        {
            tpk.about();
            }
        //exit the program.
        else if(tpk.pilih==5)
        {
        system("pause");
        return 0;
        }
        else
        {
            throw tpk.pilih;
            }
    }//close try
    catch(int x)
    {
        if (x>5 || x<1)
        cout<<"Sila pilih antara 1-5\n"; //exception message
        Sleep(1000);
        }
    }//close while
    system("pause");
}



CGPA calculator

Credit to Zata Rina, Qamariah, Rahayu

Code:

#include<iostream>
using namespace std;

class GPA
{
public:
      char nama_pelajar[20];
      char kelas_pelajar[10];
      char nama_subjek[20];
    double pointer,sum;
    int kredit,markah;
    double jumlah,jkredit;
    };

class final:public GPA
{
      public:
inline void input_process_output()
{
     
    cout<<"\n\n\n\tMasukkan Nama Subjek:";
  cin>>nama_subjek;
 
  cout<<"\n\tMasukkan Markah Subjek:";
  cin>>markah;
 
  cout<<"\n\tMasukkan Kredit:";
  cin>>kredit;
     
  sum=check_point(markah)*kredit;
 
  jumlah=jumlah+sum;
  jkredit=jkredit+kredit;
 
  cout<<"\n\tPointer Subjek:"<<sum;
 
}

double check_point(int tm)
{
    if (tm<=100&&tm>=80)
  {
      return pointer=4.0;
  }
  else if(tm<=79&&tm>=75)
  {
      return pointer=3.5;
  }
  else if(tm<=74&&tm>=70)
  {
      return pointer=3.0;
  }
  else if(tm<=69&&tm>=65)
  {
      return pointer=2.5;
  }
  else if(tm<=64&&tm>=60)
  {
      return pointer=2.0;
  }
  else if(tm<=59&&tm>=55)
  {
      return pointer=1.5;
  }
  else if(tm<=54&&tm>=50)
  {
      return pointer=1.0;
  }
  else if(tm>=50)
  {
      return pointer=0;
      }
}
};

 

int main()
{
    final CGP;
    int pilihan;
    int jabatan;
    double CGPA;
    //int jumlah_kredit;
    CGP.jumlah=0;

    cout<<"\n\t\t\t*******************************************";
  cout<<"\n\t\t\t\t\tJABATAN";
  cout<<"\n\t\t\t-------------------------------------------";
  cout<<"\n\t\t\t1 - TEKNOLOGI KEJURUTERAAN KOMPUTER";
  cout<<"\n\t\t\t2 - TEKNOLOGI KEJURUTERAAN PEMBUATAN";
  cout<<"\n\t\t\t3 - TEKNOLOGI KEJURUTERAAN ELEKTRONIK";
  cout<<"\n\t\t\t4 - TEKNOLOGI KEJURUTERAAN MEKATRONIK";
  cout<<"\n\t\t\t*******************************************";
 
 
    cout<<"\n\n\tMasukkan Nombor Jabatan Pelajar:";
  cin>>jabatan;
 
  cout<<"\n\tMasukkan Nama Pelajar:";
  cin>>CGP.nama_pelajar;

  cout<<"\n\tMasukkan Kelas Pelajar:";
  cin>>CGP.kelas_pelajar;

  do
  {

  if(jabatan==1)
  {
      cout<<"\n\t\t\t****************************************";
      cout<<"\n\t\t\tJABATAN: TEKNOLOGI KEJURUTERAAN KOMPUTER";
      cout<<"\n\t\t\t****************************************";
      CGP.input_process_output();
 
  }

  else if(jabatan==2)
  {
      cout<<"\n\t\t\t*****************************************";
      cout<<"\n\t\t\tJABATAN: TEKNOLOGI KEJURUTERAAN PEMBUATAN";
      cout<<"\n\t\t\t*****************************************";
      CGP.input_process_output();
     
  }

  else if(jabatan==3)
  {
      cout<<"\n\t\t\t******************************************";
      cout<<"\n\t\t\tJABATAN: TEKNOLOGI KEJURUTERAAN ELEKTRONIK";
      cout<<"\n\t\t\t******************************************";
      CGP.input_process_output();
     
  }

  else
  {
      cout<<"\n\t\t\t******************************************";
      cout<<"\n\t\t\tJABATAN: TEKNOLOGI KEJURUTERAAN MEKATRONIK";
      cout<<"\n\t\t\t******************************************";
      CGP.input_process_output();
     
  }


    cout<<"\n\n 1 -- MENERUSKAN PROGRAM";
  cout<<"\n\n 2 -- MENAMATKAN PROGRAM"<<endl;
  cin>>pilihan;

  //  pilihan++;
    }while(pilihan<2);
 
    CGPA=CGP.jumlah/CGP.jkredit;
     
  cout<<"\n\t\t\t**********************************";
  cout<<"\n\t\t\t----------------------------------";
    cout<<"\n\t\t\tNama Pelajar  :"<<CGP.nama_pelajar;
  cout<<"\n\t\t\tKelas Pelajar :"<<CGP.kelas_pelajar;
  cout<<"\n\t\t\tCGPA          :"<<CGPA;
 
  if(CGPA<=2.0)
  cout<<"\n\t\t\tKedudukan    : GAGAL"<<endl;
 
  else
  cout<<"\n\t\t\tKedudukan    : LULUS"<<endl;

 
  system("pause");
  return 0;
}

_________________
|----------------------------------------------------|




EXCUSE IS THE DUMBEST WAY TO ESCAPE

MAKLUMAN: Worksheet/Assignment Download Section hanya untuk pengguna berdaftar. Sila daftar untuk melakukan 'download'. Lepas dah click link, tekan kat perkataan "Skip Ad" bahagian atas belah kanan sekali. Pastu baru leh download.
Harap Maklum.

Optitech

Posts : 518
Join date : 2010-01-01
Age : 24
Location : ProxyFireZ

http://sembangseposen.blogspot.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum