Minggu, 14 Oktober 2012

Program c++


# include <iostream.h>
# include <conio.h>
void main (){

cout<< " ===============================" <<endl;
cout<< " PROGRAM TAGIHAN RENTAL KOMPUTER " <<endl;
cout<< " ===============================" <<endl;

char no [2], nm [30];
int jam ;
float biaya,potongan,total ;

   cout<<" No Komputer : " <<endl;
   cin>>no;

   cout<<" Nama Pemakai : " <<endl;
   cin>>nm;

   cout<<" Lama Pakai : " <<endl;
   cin>>jam;

   biaya = jam * 1000;

cout<< " ================================" <<endl;
biaya = jam * 1000;
if (jam > 5)
{ potongan = 0.075 * biaya ;
}                                                 

else {potongan = 0 ; }

total =biaya-potongan;

cout<< " ===============================" <<endl;
cout<< " RINCIAN TAGIHAN RENTAL KOMPUTER " <<endl;
cout<< " ===============================" <<endl;
cout <<"no komputer :" <<no<<endl;
cout <<"nama pemakai :" <<nm<<endl;
cout <<"lama pemakai :" <<jam<<endl;
cout <<"potongan :" <<potongan<<endl;
cout <<"total tagihan :" <<total<<endl;









   getch ()  ; }

Tidak ada komentar:

Posting Komentar