#include <stdio.h>
main()
{
char pilih;
float beat,tiger,scorpio,ttlbeli,ttlbayar,bunga,ptharga,kredit;
int kode, jumlah,discount,jaket,hlmmerah,hlmbiru;
beat=18000000;
tiger=30000000;
scorpio=25000000;
printf("Toko Sepeda Motor");
printf("\nMenjual 3 macam sepeda motor diantaranya : ");
printf("\n\n(42) Beat Rp. 18.000.000,00\n-Beli lebih dari 5 dapat bonus 1\n-Setiap sepeda motor dapat 1 jaket");
printf("\n\n(22) Tiger Rp. 30.000.000,00\n-Setiap sepeda motor dapat 1 helm merah");
printf("\n\n(32) Scorpio Rp. 25.000.000,00\n-Setiap sepeda motor dapat 1 helm biru");
printf("\n\nDapat kredit ataupun cash");
printf("\nDapatkan discountnya !!!");
printf("\n\nMasukkan :");
printf("\nKredit/Cash (k/c) ? \t : "); scanf("%c", &pilih);
printf("\nKode Sepeda Motor \t : "); scanf("%d", &kode);
printf("\nJumlah Sepeda Motor \t : "); scanf("%d", &jumlah);
{
if(kode==42)
ttlbeli=beat*jumlah;
else if(kode==22)
ttlbeli=tiger*jumlah;
else if(kode==32)
ttlbeli=scorpio*jumlah;
else
printf("\nKODE TIDAK ADA !!!");
}
{
if(kode==42)
{
if(pilih=='c' || pilih== 'C')
discount=3;
else if(pilih=='k' || pilih=='K')
discount=3;
}
else
discount=0;
}
{
if(kode==22 || kode==32)
{
if(pilih=='c' || pilih== 'C')
discount=5;
else if(pilih=='k' || pilih=='K')
bunga=5;
}
else
discount=0;
main()
{
char pilih;
float beat,tiger,scorpio,ttlbeli,ttlbayar,bunga,ptharga,kredit;
int kode, jumlah,discount,jaket,hlmmerah,hlmbiru;
beat=18000000;
tiger=30000000;
scorpio=25000000;
printf("Toko Sepeda Motor");
printf("\nMenjual 3 macam sepeda motor diantaranya : ");
printf("\n\n(42) Beat Rp. 18.000.000,00\n-Beli lebih dari 5 dapat bonus 1\n-Setiap sepeda motor dapat 1 jaket");
printf("\n\n(22) Tiger Rp. 30.000.000,00\n-Setiap sepeda motor dapat 1 helm merah");
printf("\n\n(32) Scorpio Rp. 25.000.000,00\n-Setiap sepeda motor dapat 1 helm biru");
printf("\n\nDapat kredit ataupun cash");
printf("\nDapatkan discountnya !!!");
printf("\n\nMasukkan :");
printf("\nKredit/Cash (k/c) ? \t : "); scanf("%c", &pilih);
printf("\nKode Sepeda Motor \t : "); scanf("%d", &kode);
printf("\nJumlah Sepeda Motor \t : "); scanf("%d", &jumlah);
{
if(kode==42)
ttlbeli=beat*jumlah;
else if(kode==22)
ttlbeli=tiger*jumlah;
else if(kode==32)
ttlbeli=scorpio*jumlah;
else
printf("\nKODE TIDAK ADA !!!");
}
{
if(kode==42)
{
if(pilih=='c' || pilih== 'C')
discount=3;
else if(pilih=='k' || pilih=='K')
discount=3;
}
else
discount=0;
}
{
if(kode==22 || kode==32)
{
if(pilih=='c' || pilih== 'C')
discount=5;
else if(pilih=='k' || pilih=='K')
bunga=5;
}
else
discount=0;