You are on page 1of 8

SOAL QUIZ 1

Nama :Siswanto Wardoyo Nim : 13190287

Reza Dwiputra 13190288

#include <stdio.h>

#include <conio.h>

#include <iostream.h>

#include <iomanip.h>

main()

int x,y;

char nm_pem[4][25], kode [4], nm_bar[4][25], ukuran[4], lagi;

int jml_beli[4], hrg[4], ubay[4], ukel[4];

long tobar[4],subtotal[4];

float ppn=0.1;

atas:

clrscr();

cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;

cout<<" Toko Baju Sentosa "<<endl;

cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;

cout<<"Masukan Banyak Data : ";cin>>y;

cout<<"A. Baju H&M\n"<<endl;

cout<<"1. Ukuran S = 15000 \n"<<endl;

cout<<"2. Ukuran M = 20000\n"<<endl;


cout<<"3. Ukuran L = 30000\n"<<endl;

cout<<"B. Baju Prada\n"<<endl;

cout<<"1. Ukuran S = 15500\n"<<endl;

cout<<"2. Ukuran M = 22000\n"<<endl;

cout<<"3. Ukuran L = 34000\n"<<endl;

cout<<"C. Baju Gucci\n"<<endl;

cout<<"1. Ukuran S = 17000\n"<<endl;

cout<<"2. Ukuran M = 25000\n"<<endl;

cout<<"3. Ukuran L = 39900\n"<<endl;

cout<<"D. Baju Louis\n"<<endl;

cout<<"1. Ukuran S = 19900\n"<<endl;

cout<<"2. Ukuran M = 29900\n"<<endl;

cout<<"3. Ukuran L = 59900\n"<<endl;

cout<<endl;

for (x=1; x<=y;x++)

cout<<"Data Ke : "<<x<<endl;

cout<<"Nama Pembeli : ";cin>>nm_pem[x];

cout<<"Kode Baju [A/B/C/D] : ";cin>>kode[x];

cout<<"Ukuran Baju [S/M/L] : ";cin>>ukuran[x];

cout<<"Jumlah Beli : ";cin>>jml_beli[x];

cout<<endl;

if (kode[x] == 'A'){

strcpy(nm_bar[x],"Baju H&M");

if(ukuran[x] == 'S'){

hrg[x] = 150000;

else if(ukuran[x] == 'M'){


hrg[x] = 200000;

else{

hrg[x] = 300000;

else if (kode[x] == 'B'){

strcpy(nm_bar[x],"Baju Prada");

if(ukuran[x] == 'S'){

hrg[x] = 155000;

else if(ukuran[x] == 'M'){

hrg[x] = 220000;

else{

hrg[x] = 340000;

else if (kode[x] == 'C'){

strcpy(nm_bar[x],"Baju Gucci");

if(ukuran[x] == 'S'){

hrg[x] = 170000;

else if(ukuran[x] == 'M'){

hrg[x] = 250000;

else{
hrg[x] = 399000;

else {

strcpy(nm_bar[x],"Baju Louis");

if(ukuran[x] == 'S'){

hrg[x] = 199000;

else if(ukuran[x] == 'M'){

hrg[x] = 299000;

else{

hrg[x] = 599000;

subtotal[x] = hrg[x] * jml_beli[x];

ppn = subtotal[x] * 0.1;

tobar[x]= subtotal[x] + ppn;

cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;

cout<<endl;

cout<<" Toko Baju Sentosa "<<endl;

cout<<endl;

cout<<"+++++++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;

for (x =1;x<=y;x++)

cout<<"Nama Pembeli : "<<nm_pem[x]<<endl;

cout<<"Kode Baju : "<<kode[x]<<endl;

cout<<"Ukuran Baju : "<<ukuran[x]<<endl;


cout<<"Harga Baju : "<<hrg[x]<<endl;

cout<<"Jumlah Beli : "<<jml_beli[x]<<endl;

cout<<"SubTotal : "<<subtotal[x]<<endl;

cout<<"PPN : "<<ppn<<endl;

cout<<"Total Bayar : "<<tobar[x]<<endl;

cout<<"Uang Bayar : ";cin>>ubay[x];

ukel[x]= ubay[x] - tobar[x];

cout<<"Uang Kembali : "<<ukel[x]<<endl;

cout<<"\n\n Ingin Input Data Lagi [Y/T] : ";

lagi = getche();

if (lagi == 'Y'||lagi == 'y')

goto atas;

return 0;

You might also like