Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

ALGORI

TMADANPEMPROGRAMAN

NAMA:WI WIRAHMADANI
NNOBP:20101152630251
KELAS:I
F5

FLOWCHART:

BAHASAPROGRAM

#include<st dio.h>
#include<coni o.h>
#include<st ri
ng. h>
main( )
{
charkb[ 10][50];
charnb[ 15][50];
l
ongi nthg[ 50];
l
ongi ntjl[50];
charadl ='y'
;
i
ntjd=1, x,bari
s;
l
ongi ntt ot,
totp=0;
fl
oatdi s,
pem;
while((
adl =='y'
||
adl=='
Y')
&&j
d<=50)
{
clr
scr();
gotox y(25,5);
print
f("
ENTRYDATAPEMBELI
AN"
);
got ox y(
25,6) ;
pr i
ntf
("====================" );
got ox y(
25,8) ;
pr i
ntf
("KODEBARANG: "
);
scanf("%s",&kb[jd]);
got ox y(
25,9) ;
pr i
ntf
("NAMABARANG: ");
scanf("
%s" ,&nb[jd]);
got ox y(
25,10) ;pri
ntf
("HARGA: ");
scanf (
"%i"
,&hg[j
d] )
;
got ox y(
25,11) ;pri
ntf
("JUMLAH: "
) ;
scanf("
%i",
&jl[
jd])
;ffl
ush( stdi
n);
j
d=j d+1;
got ox y(
25,12) ;pri
ntf
("ADADATALAGI [
Y/T]:
");
scanf ("
%c" ,&adl);
ff
lush(st
din);
}
clrscr();
got ox y(
25,1) ;
pr i
ntf
("LAPORANPEMBELI ANBARANG" )
;
got ox y(
1,2);printf
("\
n---
---
--
----
--
--
----
--
--
--
---
--
--
---
--
--
----
--
---
---
---
---
--
---
--
--
---
--
--
---
--
--
--
-"
);
got ox y(
1,3);printf
("\
n|NO| KODE| NAMABARANG| Harga| JUMLAH| TOTAL| DI
SCOUNT|
PEMBAYARAN| ");
got ox y(
1,4);printf
("\
n---
---
--
----
--
--
----
--
--
--
---
--
--
---
--
--
----
--
---
---
---
---
--
---
--
--
---
--
--
---
--
--
--
-"
);
bar is=6;
for(x=1; x<=jd-1;x++)
{
tot=hg[ x]*j
l[x]
;
i
f( tot>=500000){
dis=0. 2*tot;
}
elsei f(tot>=250000){
dis=0. 15* t
ot ;
}
elsei f(tot>=100000){
dis=0. 1*tot;
}
elsei f(tot<100000){
dis=0;
}
pem=t ot-dis;
totp=t otp+pem;
got ox y(
1,bar i
s) ;
pri
ntf(
"|
");
got ox y(
2,bar i
s) ;
pri
ntf(
"%i",
x);
got ox y(
6,bar i
s) ;
pri
ntf(
"|
");
got ox y(
8,bar i
s) ;
pri
ntf(
"%s",kb[x])
;
got ox y(
14,bar is);
pri
ntf(
"|"
);
got ox y(
16,bar is);
pri
ntf(
"%s" ,
nb[x]);
got ox y(
32,bar is);
pri
ntf(
"|"
);
got ox y(
34,bar is);
pri
ntf(
"%li",
hg[x]);
got ox y(
40,bar is);
pri
ntf(
"|"
);
got ox y(
42,bar is);
pri
ntf(
"%li",
jl
[x]
);
got ox y(
50,bar is);
pri
ntf(
"|"
);
got ox y(
52,bar is);
pri
ntf(
"%li",
tot);
got ox y(
60,bar is);
pri
ntf(
"|"
);
got ox y(
62,bar is);
pri
ntf(
"%6. 1f",
dis);
got ox y(
71,bar is);
pri
ntf(
"|"
);
got ox y(
72,bar is);
pri
ntf(
"%6. 1f",
pem) ;
got ox y(
84,bar is);
pri
ntf(
"|"
);
bar is++;
}
got ox y(
1,bar i
s) ;
pri
ntf(
"-
---
--
----
---
--
---
--
---
--
--
---
--
--
--
---
---
----
--
--
----
---
---
--
--
--
--
--
--
---
--
--
--
--
-")
;
got ox y(
2,bar i
s) ;
pri
ntf(
"\nTOTALPEMBAYARAN: %li",
tot
p) ;
get ch();
}
HASI
L

You might also like