Anda di halaman 1dari 5

Nama:BagusBudiPangestu

NIM :181021400173
Ruang:742
UTSprati
kum st
rukt
urdat
a

Codi
ngan:
#i
ncl
ude<i
ost
ream>
usi
ngnamespacest
d;

/
/Compi
l
erv
ersi
ong++6.
3.0

i
ntmai
n()
{
st
ri
ngul
ang="
y";

i
ntno,
nomn,
menu,
nc=15000,
nu =10000,
et
m =1000,
ej
=2000,
j
ml,
t
otal
=0,
t
otal
byr
,
by
r,
t
tl
,
di
sc;

cout
<<"
--
-Sel
amatDat
angDi
War
teg(
Bagus)
--
-"
<<endl
;

whi
l
e(ul
ang=="
y")
{
cout
<<"
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-"
<<endl
;
cout
<<"
1.Makanan"
<<endl
;
cout
<<"
2.Mi
numan"
<<endl
;
cout
<<"
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-"
<<endl
;
cout
<<"
Sil
ahkanPi
l
ihMakan/
minum :
";
ci
n>>no;

i
f(
no==1)
{
cout
<<"
--
--
--
--
--
--
MAKANAN-
--
--
--
--
--
-"
<<endl
;
cout
<<"
01.Nasi
Campur\
t\t\
t\t
:Rp.15.
000"<<endl
;
cout
<<"
02.Nasi
Uduk\
t\t\
t\t\
t\t
:Rp.10.
000"<<endl
;
cout
<<"
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
"<<endl
;

}
elsei
f(
no==2)
{
cout
<<"
--
--
--
--
--
--
MINUMAN-
--
--
--
--
--
-"
<<endl
;
cout
<<"
11.EsTehMani
s\t\
t\t\
t:Rp.1.
000"<<endl
;
cout
<<"
22.EsJer
uk \
t\t\
t\t
:Rp.2.
000"<<endl
;
cout
<<"
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-"
<<endl
;
}
el
se{
cout
<<"
Dat
ayangdi
masukansal
ah"
<<endl
;
br
eak;
}
cout
<<"
Sil
ahkanPi
l
ihMenu\
t:"
;
ci
n>>nomn;
cout
<<"
MasukanJuml
ahBel
i\t
:";
ci
n>>j
ml;
cout
<<"
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-"
<<endl
;
i
f(
nomn==01)
{
t
tl=nc*
jml
;
t
otal
=tot
al+nc*
jml
;

}
elsei
f(
nomn==02)
{
t
tl=nu*
jml
;
t
otal
=tot
al+nu*
jml
;
}

i
f(
nomn==11)
{
t
tl=et
m*j
ml;
t
otal
=tot
al+et
m*j
ml;

}
elsei
f(
nomn==22)
{
t
tl=ej
*j
ml;
t
otal
=tot
al+ej
*jml
;

}
cout
<<"
Tot
al\
t\t\
t\t\
t\t\
t\t\
t\t\
t\t
:Rp."
<<t
tl
<<endl
;
cout
<<"
Apakahi
ngi
npesanl
agi
?"<<endl
;
cout
<<"
jawab[
y/n]
:"
;
ci
n>>ul
ang;
}
cout
<<"
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
"<<endl
;
cout
<<"
Tot
alHar
ga\
t\t\
t\t\
t\t\
t:Rp.
"<<t
otal
<<endl
;

i
f(t
otal
>50000)
{

di
sc=t
otal
*10/
100;

cout
<<"
Mendapat
kanDi
skon(
10%)
:Rp."
<<di
sc<<endl
;

}
else{
cout<<"
AndaTi
dakMendapat
kanDi
skon"
<<endl
;
}

t
otal
byr=t
otal
-di
sc;

cout
<<"
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-"
<<endl
;
cout
<<"
Tot
alBay
ar\
t\t\
t\t\
t\t\
t:
Rp.
"<<t
otal
byr
<<endl
;
cout
<<"
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-"
<<endl
;
cout
<<"
MasukanJuml
ahUang\
t:Rp.
";
ci
n>>by
r;

i
ntkembal
i=by
r-t
otal
byr
;

cout
<<"
UangKembal
i
an\
t\t
\t\
t\t
:Rp."
<<kembal
i<<endl
;

cout
<<"
--
--
--
--
--
--
--
--
--
--
--
--
--
--
--
-"
<<endl
;
cout
<<"
--
--
--
--
-TERI
MAKASI
H--
--
--
--
--
-"
<<endl
;
r
etur
n0;

}
Hasi
lscr
eenshoot:

Anda mungkin juga menyukai