#include <conio.h>
#include <stdio.h>
#include <iostream.h>
#include <iomanip.h>
main()
{
int jumbay, jumbel, harga, bayar, kembali=0;
char kode, merk[15], ukuran, nama[20], ket[10];
cout<<" TOKO KELONTONG KERONCONGAN "<<endl;
cout<<"------------------------------------------------------------\n"<<endl;
cout<<"A. Susu Dancow B. Susu Bendera C. Susu SGM"<<endl;
cout<<" 1. Ukuran Kecil 1. Ukuran Kecil 1. Ukuran Kecil"<<endl;
cout<<" 2. Ukuran Sedang 2. Ukuran Sedang 2. Ukuran Sedang "<<endl;
cout<<" 3. Ukuran Besar 3. Ukuran Besar 3. Ukuran Besar "<<endl;
cout<<endl;
cout<<"Masukkan Nama Pembeli : ";cin>>nama;
cout<<"Masukkan Kode Susu [A/B/C] : ";cin>>kode;
cout<<"Masukkan Ukuran Kaleng [K/S/B] : ";cin>>ukuran;
if (kode=='A' || kode=='a')
{
strcpy (merk, "Susu Dancow") ;
if (ukuran=='K' || ukuran=='k')
{strcpy(ket,"Kecil");
harga=25000;}
else if (ukuran=='S' || ukuran=='s')
{strcpy(ket,"Sedang");
harga=20000;}
else
{strcpy(ket,"Besar");
harga=15000;}
}
else if (kode=='B' || kode=='b' )
{
strcpy (merk, "Susu Bendera") ;
if (ukuran=='K' || ukuran=='k')
{strcpy(ket,"Kecil");
harga=20000;}
else if (ukuran=='S' || ukuran=='s')
{strcpy(ket,"Sedang");
harga=17500;}
else
{strcpy(ket,"Besar");
harga=13500;}
}
else if (kode=='C' || kode=='c' )
{
strcpy (merk, "Susu SGM") ;
if (ukuran=='K' || ukuran=='k')
{strcpy(ket,"Kecil");
harga=22000;}
else if (ukuran=='S' || ukuran=='s')
{strcpy(ket,"Sedang");
harga=16500;}
else
{strcpy(ket,"Besar");
harga=15000;}
}
cout<<"Jumlah yang Dibeli : ";cin>>jumbel;
clrscr();
jumbay=harga*jumbel;
kembali=bayar-jumbay;
cout<<" TOKO KELONTONG KERONCONGAN "<<endl;
cout<<"---------------------------------------------------\n"<<endl;
cout<<"Nama Pembeli : "<<nama<<endl;
cout<<"Merk Susu : "<<merk<<endl;
cout<<"Ukuran Kaleng : "<<ket<<endl;
cout<<"Harga Satuan Barang Rp. "<<harga<<endl;
cout<<"Jumlah Beli Susu : "<<jumbel<<endl;
cout<<"Harga yang Harus Dibayar Rp. "<<jumbay<<endl;
cout<<"---------------------------------------------------\n"<<endl;
cout<<" TERIMA KASIH "<<endl;
getch();
}
Check result Outputnya :
Tidak ada komentar:
Posting Komentar