Sunday, April 12, 2009

{Latihan UTS C++
#include,,conio.h,,
#include,,stdio.h,,
#include,,iostream.h,,
main()
{
char nm[25],lagi,*nmkue;
int no,jml,hrg,total,ukem,ubay;
clrscr();
cout<<"\tTOKO KUE ENAK TAMA",,endl
cout<<"\tJl.Kebagusan No.14",,endl
cout<<"*************************************",,endl
cout<<"No NamaKue Harga ",,endl
cout<<"=====================================",,endl
cout<<"1. Bolu Rp.10.000",,endl
cout<<"2. Blakforest Rp.40.000",,endl
cout<<"3. Donat Rp.4.500",,endl
cout<<"************************************",,endl
cout<<"Nama pembeli :";cin>>nm;
cout<<"Jumlah Beli :";cin>>jml;
cout<<"Masukkan Kode Kue[1/2/3]:";cin>>no;

if(no==1)
{nmkue="Bolu";
hrg=10000;}
else if(no==2)
{nmkue="Black Forest";
hrg=40000;}
else
{nmkue="Donat";
hrg=4500;}
total=jml*hrg;
clrscr();
cout<<"\tTOKO KUE ENAK TAMA",,endl
cout<<"\tJl.kebagusan No.14",,endl
cout<<"***************************************",,endl
cout<<"Nama pembeli :",,nm,,endl
cout<<"Kue Yang Dibeli:",,nmkue,,endl
cout<<"Harga Persatuan:Rp.",,hrg,,endl
cout<<"Jumlah Beli :",,jml,,endl
cout<<"Total :Rp.",,total,,endl
cout<<"======================================="<
cout<<"Uang bayar :Rp.";cin>>ubay;
ukem=ubay-total;
cout<<"Uang Kembali :Rp.",,ukem,,endl
cout<<"***************************************",,endl
cout<<" TERIMA KASIH ATAS KUNJUNGANNYA",,endl
getch();
}
(tolong tanda ,, diganti dengan << karena format dalam html tidak mendukung....terima kasih)
Categories:

0 komentar:

Post a Comment

Subscribe to RSS Feed Follow me on Twitter!