#include "stdio.h"
#include "conio.h"
struct toko
{
char nama_pembeli[50];
char nama_barang[25];
};
struct toko brg;
void main()
{
long harga,jumlah_barang,jumlah_harga,diskon,total_harga;
clrscr();
cout<<"INPUT DATA\n";
cout<<"------------------------------\n";
cout<<"Nama pembeli = ";gets(brg.nama_pembeli);
cout<<"Nama barang = ";gets(brg.nama_barang);
cout<<"Harga = ";cin>>harga;
cout<<"Jumlah barang = ";cin>>jumlah_barang;
cout<<"-------------------------------\n";
{
jumlah_harga =(harga * jumlah_barang);
diskon=(jumlah_harga *5/100);
total_harga=(jumlah_harga-diskon);
}
cout<<"\nNama pembeli = "<<brg.nama_pembeli;
cout<<"\nNama barang = "<<brg.nama_barang;
cout<<"\nHarga = "<<harga;
cout<<"\nJumlah barang = "<<jumlah_barang;
cout<<"\nJumlah harga = "<<jumlah_harga;
cout<<"\nDiskon 5% = "<<diskon;
cout<<"\nTotal harga = "<<total_harga;
getch();
}
No comments:
Post a Comment