#include
#include
main()
{
char kode,*merk,kd_type,*type,tanya;
long harga,total,bayar,kembali;
int jml;
mulai:
clrscr();
cout <<" TOKO ELEKTRONIK"<
cout <<"Kode Type = ";cin>>kd_type;
cout <<"Jumlah Beli = ";cin>>jml;
switch (kode)
{
case 'A':case 'a':
merk = "TV SAMSUNG";
switch (kd_type)
{
case '1':
type ="29 inchi";
harga =4500000;
break;
case '2':
type ="21 inchi";
harga =2500000;
break;
default:
type ="14 inchi";
harga =1750000;
break;
}
case 'B':case 'b':
merk = "TV LG";
switch (kd_type)
{
case '1':
type ="29 inchi";
harga =3750000;
break;
case '2':
type ="21 inchi";
harga =2200000;
break;
default:
type ="14 inchi";
harga =16500000;
break;
}
default:
merk ="PANASONIC";
switch (kd_type)
{
case '1':
type ="29 inchi";
harga =3850000;
break;
case '2':
type ="21 inchi";
harga =2400000;
break;
default:
type ="14 inchi";
harga =1800000;
break;
}
}
clrscr();
cout <<" TOKO ELEKTRONIK"<
cout <<"Total Bayar = "<
kembali=bayar-total;
cout <<"--------------------------------------"<
if (tanya=='Y'||tanya=='y')
goto mulai;
else
goto selesai;
getch();
selesai:
}
Tugas C++