LISTING PROGRAM :
#include <stdio.h>
#include <conio.h>
char tanya;
void main ()
{
do{
int jenis_kain, kualitas, total_harga, diskon, total_barang, harga, harga_asli;
clrscr();
printf ("\t\t\t +---------------------------------------+\n");
printf ("\t\t | TOKO BAHAN KAIN |\n");
printf ("\t\t +=======================================+\n");
printf ("\t\t | JENIS KAIN |\n");
printf ("\t\t | 1. Katun Biasa |\n");
printf ("\t\t | 2. Katun Polisma |\n");
printf ("\t\t | 3. Katun Ima |\n");
printf ("\t\t | 4. Shantung Biasa |\n");
printf ("\t\t | 5. Shantung Jepang |\n");
printf ("\t\t | 6. Taffeta Biasa |\n");
printf ("\t\t | 7. Taffeta Dove |\n");
printf ("\t\t | 8. Satin Polos |\n");
printf ("\t\t | 9. Satin Velvet |\n");
printf ("\t\t | 10. Satin Stretch |\n");
printf ("\t\t | 11. Chiffon Biasa |\n");
printf ("\t\t | 12. Chiffon Double |\n");
printf ("\t\t | 13. Chiffon nicon |\n");
printf ("\t\t | 14. Satin Duches |\n");
printf ("\t\t | 15. Satin Silky |\n");
printf ("\t\t +---------------------------------------+\n\n");
printf ("\tPilih jenis kain\t:\t");
scanf ("%d", &jenis_kain);
printf ("\tMasukkan ukuran barang (meter)\t:\t");
scanf ("%d", &total_barang);
printf ("\n");
switch(jenis_kain)
{
case 1: harga=15;
getch();
break;
case 2: harga=35;
getch();
break;
case 3: harga=60;
getch();
break;
case 4: harga=15;
getch();
break;
case 5: harga=25;
getch();
break;
case 6: harga=15;
getch();
break;
case 7: harga=25;
getch();
break;
case 8: harga=15;
getch();
break;
case 9: harga=30;
getch();
break;
case 10: harga=30;
getch();
break;
case 11: harga=15;
getch();
break;
case 12: harga=10;
getch();
break;
case 13: harga=15;
getch();
break;
case 14: harga=30;
getch();
break;
case 15: harga=30;
getch();
break;
default:
printf("\tanda salah memasukkan pilihan, hitung ulang ? (y/n)");
}
harga_asli=total_barang*harga;
if (total_barang>20)
diskon=harga_asli*0.20;
else
diskon=0;
total_harga=harga_asli-diskon;
clrscr();
printf ("\t\t\t+----------------------------------------+\n");
printf ("\t\t\t\t\tStroke Belanja\n");
printf ("\t\t +========================================+\n");
printf ("\t\t\t Harga Kain Per meter: Rp.%d", harga);printf("000 \n");
printf ("\t\t\t Ukuran Kain per-meter\t : %d \n", total_barang);
printf ("\t\t\t Total\t\t : Rp.%d", harga_asli);printf("000 \n");
printf ("\t\t\t Diskon\t\t : Rp.%d", diskon);printf("000 \n");
printf ("\t\t\t Total harga\t : Rp.%d", total_harga);printf("000 \n");
printf ("\n");
printf ("\t\t\t-+Terima Kasih. Silakan Berbelanja lagi+-\n\n");
printf ("\t\t +----------------------------------------+\n\n");
printf("\t\t Ulangi Lagi [Y//T] ? ");
tanya = getch();
fflush(stdin);
}
while(tanya =='y' || tanya == 'T');
}
Tidak ada komentar:
Posting Komentar