Rabu, 27 April 2011

Tugas 6 c++

#include<conio.h>
#include<stdio.h>
#include<iostream.h>
main()
{
char kodebrg[5],namabrg[30];
int jml_beli;
float harga,total_harga,total_bayar,diskon;
cout<<" TOKO SEMUA ADA "<<endl;
cout<<" Jl.Padasuka No.74 Tangerang Tenggara "<<endl;
cout<<"-----------------------------------------------------"<<endl;
cout<<"Kode barang : ";cin>>kodebrg;
cout<<"Nama barang : ";gets(namabrg);
cout<<"Jumlah beli : ";cin>>jml_beli;
cout<<"Harga : Rp.";cin>>harga;
cout<<"-------------------------------------------------------"<<endl;
total_harga=harga*jml_beli;
cout<<"Total harga : Rp."<<total_harga<<endl;
if (total_harga > 150000)
diskon=total_harga*20/100;
else
diskon=0;
cout<<"Diskon : Rp."<<diskon<<endl;
total_bayar=total_harga-diskon;
cout<<"Total bayar : Rp."<<total_bayar<<endl;
cout<<endl;
cout<<" T E R I M A K A S I H "<<endl;
getch();
download
}

Tidak ada komentar:

Posting Komentar