Perintah input dan keluaran

inputoutput.gif

#include<iostream.h>
#include<conio.h>
main()
{
int lembar;
float harga,diskon,jumlah,bayar,dibayar,kembalian,kurang;
cout<<"| ================== |"<<endl;
cout<<"|==========TRANSAKSI FOTOCOPY============|"<<endl;
cout<<"| ================== |"<<endl;
cout<<"|========================================|"<<endl;
cout<<"| Jumlah lembar fotocopy : " ; cin>>lembar;
gotoxy (42,5); cout <<"|"<<endl;
cout<<"| Harga perlembar : Rp. " ; cin>>harga;
gotoxy (42,6); cout <<"|"<<endl;
jumlah=lembar*harga;
diskon=jumlah*0.1;
bayar=jumlah-diskon;
cout<<"| Jumlah bayar : Rp. "<<jumlah<<endl;
gotoxy (42,7); cout <<"|"<<endl;
cout<<"| Diskon : Rp. "<<diskon<<endl;
gotoxy (42,8); cout <<"|"<<endl;
cout<<"| Besar pembayaran : Rp. "<<bayar<<endl;
gotoxy (42,9); cout <<"|"<<endl;
cout<<"|========================================|"<<endl;
cout<<"| Dibayar : Rp. "; cin>>dibayar;
gotoxy (42,11); cout <<"|"<<endl;
cout<<"|========================================|"<<endl;
kembalian=dibayar-bayar;
kurang=bayar-dibayar;
if (dibayar>=bayar)
cout<<"| LUNAS, kembalian : Rp. "<<kembalian<<endl;
else
cout<<"| TIDAK LUNAS, kurang : Rp. "<<kurang<<endl;
gotoxy (42,13); cout <<"|"<<endl;
cout<<"|========================================|"<<endl;
getch();
}

Posted on Desember 17, 2007, in C++ and tagged , , , , . Bookmark the permalink. 1 Komentar.

  1. thanks 4 inf0,boleh kan kosultasi2 ttg pemograman,krna saya krg memahami…thankz

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

%d blogger menyukai ini: