Kamis, 08 Maret 2012

example of simple program borland C++


#include<conio>
#include<stdio>
#include<iostream>
main()
{

char nk[20],nb[20],kb;
long int jb,tb,hb,uk,th,tun;
float pot;

clrscr();
cout<<"=*=*=*=*=*=*=*=*=*=*=*="<<endl;
cout<<"Nama Kasir = ";cin>>nk;
cout<<"Nama Barang = ";cin>>nb;
cout<<"Harga Barang = ";cin>>hb;
cout<<"Masukan Jumlah Beli = ";cin>>jb;
cout<<"tunai =";cin>>tun;
cout<<"======================="<<endl;

th=hb*jb;

if(th>=50000)
{
pot=0.1*th;
}
else
{
pot=0;
}
tb=th-pot;
uk=tun-tb;



cout<<"======================="<<endl;
cout<<"Total Harganya = "<<th<<endl;
cout<<"Potongan = "<<pot<<endl;
cout<<"======================="<<endl;
cout<<"Total Bayar = "<<tb<<endl;
cout<<"Tunai = "<<tun<<endl;
cout<<"Uang Kembali ="<<uk<<endl;
cout<<"\t TOKO GELAP GELAP'"<<endl;
cout<<"       JL. Sarkem Raya No.3"<<endl;
cout<<"\t Telepon 085303030303"<<endl;
getch();

}

0 komentar:

Posting Komentar

Template by:

Free Blog Templates