11.10.15

Program C++ Latihan Mini Market dengan Diskon

#include <conio.h>
#include <iostream.h>
#include <stdio.h>

void main()
{
int a,b,c,d,e,f,g,h;
cout << "                             PROGRAM BY TRY PW "<<endl;
cout <<endl;
cout << "============================" <<endl;
cout << "     GESREK MINI MARKET" <<endl;
cout << "============================" <<endl;
cout << "1. Beras         : Rp. ";cin>>a;
cout << "2. Terigu        : Rp. ";cin>>b;
cout << "3. Minyak Goreng : Rp. ";cin>>c;
cout << "4. Telur         : Rp. ";cin>>d;
cout << "5. Mentega       : Rp. ";cin>>e;
cout << "============================" <<endl;
f=a+b+c+d+e;
cout << "Total Belanja    : Rp. " << f << endl;
if (f >= 100000 && f)
{
g=(f*10)/100;
cout<<endl;
cout << "Selamat Anda mendapat Diskon 10% "<<endl;
cout<<endl;
cout << "Diskon 10%       : Rp. " << g <<endl;
}
else if (f >= 0 && f < 100000)
{
g=(f*5)/100;
cout<<endl;
cout << "Selamat Anda mendapat Diskon 5% "<<endl;
cout<<endl;
cout << "Diskon 5%        : Rp. " << g <<endl;
}
h=f-g;
cout << "Total Pembayaran : Rp. "<<h<<endl;
getch();
}

Rekomendasi Lainnya

0 komentar:

Posting Komentar

Masukan komentar anda dibawah, saya akan merasa senang bila diberi masukan. Silahkan jika sobat ingin request.please don't SPAMMING.
Terima Kasih atas pengertiannya.