APLIKASI MESIN KASIR DENGAN BORLAND C++
(“#include<iostream>”,`“#include<conio.h>”, dan “#include<cstring>”), bentuk if ke 3, dan perintah aritmatika. Berikut adalah sintaxnya :
//nama program:mesin kasir
#include<iostream>
#include<conio>
#include<cstring>
main()
{
int total, mouse=50000, DVD=3000, FD=75000, x, y, z, dis,a, b1, b2, b3, w, f, n, h;
cout<<"================================================================================"<<endl;
cout<<" TOKO PERLENGKAPAN KOMPUTER "<<endl;
cout<<"================================================================================"<<endl;
cout<<"1. Mouse = Rp 50.000,-"<<endl;
cout<<"2. DVD = Rp 3.000,-"<<endl;
cout<<"3. FD = Rp 75.000,-"<<endl;
cout<<endl;
cout<<"PEMBELIAN DI ATAS Rp 500.000 MENDAPATKAN POTONGAN 10%"<<endl;
cout<<"==============================================================================="<<endl;
cout<<endl;
cout<<"Input nama barang 1 :";
cin>>"mouse";
cout<<"banyak barang :";
cin>>x;
b1=mouse*x;
cout<<"Jumlah 1 : Rp "<<b1;
cout<<",-"<<endl;
cout<<endl;
cout<<"Input nama barang 2 :";
cin>>"DVD";
cout<<"banyak barang :";
cin>>y;
b2=DVD*y;
cout<<"Jumlah 2 : Rp "<<b2;
cout<<",-"<<endl;
cout<<endl;
cout<<"Input nama barang 3 :";
cin>>"FD";
cout<<"banyak barang :";
cin>>z;
b3=FD*z;
cout<<"Jumlah 3 : Rp "<<b3;
cout<<",-"<<endl;
cout<<endl;
cout<<"==============================================================================="<<endl;
a=b1+b2+b3;
cout<<"Total pembelian = Rp "<<a;
cout<<",-"<<endl;
cout<<endl;
cout<<endl;
if(a>500000)
{
w=(10*a)/100;
cout<<"discount =Rp "<<w;
cout<<",-"<<endl;
cout<<endl;
}
else
{
w=0;
cout<<"discount =Rp "<<w;
cout<<",-"<<endl;
cout<<endl;
}
n=a-w;
cout<<"Total bayar = Rp "<<n;
cout<<",-"<<endl;
cout<<endl;
cout<<"Uang pembayaran = Rp ";
cin>>f;
h=f-n;
cout<<"Uang Kembalian = Rp "<<h;
cout<<",-"<<endl;
cout<<endl;
cout<<endl;
cout<<"================================================================================"<<endl;
cout<<" Terima Kasih Atas Kunjungan Anda";
getch();
}
Selamat mencoba.....!!!!!!!
Kalu belum paham jangan sungkan-sungkan
sob, tanyakan saja dikomentar.
Sekian dulu dari saya, saya selaku
manusia biasa, apabila ada kata yang salah saya minta maaf.
WASALAMUA’ALAIKUM WR.WB.
0 Response to "APLIKASI MESIN KASIR DENGAN BORLAND C++"
Post a Comment