#include <iostream.h>
#include <conio.h>
void cetak(int klm, int brs, char *teks)
{
gotoxy(brs,klm);cout<<teks;
}
void cetakc(int brs, char *teks)
{
gotoxy(40-(strlen(teks)/2),brs);cout<<teks;
}
int hi_jmlhg(int a,int b)
{
return(a*b);
}
float hi_diskon(int d, int jml)
{
return((d/100)*jml);
}
float hi_hgbyr
void header(){
cetakc(1,"TOKO MAJU MUNDUR SEJATI");
cetakc(2,"Jln Godean Km. 6,5");
cetak(4,2,"===============================================================================");
cetak(5,2,"|");
cetak(5,4,"No.");
cetak(5,8,"|");
cetak(5,12,"Nama Barang");
cetak(5,26,"|");
cetak(5,28,"Jml Beli");
cetak(5,37,"|");
cetak(5,39,"Hrg Satuan");
cetak(5,50,"|");
cetak(5,52,"jml Hrg");
cetak(5,60,"|");
cetak(5,62,"Diskon");
cetak(5,69,"|");
cetak(5,71,"Hg Bayar");
cetak(5,80,"|");
cetak(6,2,"===============================================================================");
}
void isi()
{
int i;
for(i=1;i<=10;i++)
{
cetak(6+i,2,"|");
cetak(6+i,8,"|");
cetak(6+i,26,"|");
cetak(6+i,37,"|");
cetak(6+i,50,"|");
cetak(6+i,60,"|");
cetak(6+i,69,"|");
cetak(6+i,80,"|");
}
cetak(6+i,2,"===============================================================================");
cetak(7+i,2,"|");
cetak(7+i,57,"Total Harga");
cetak(7+i,69,"|");
cetak(7+i,80,"|");
cetak(8+i,2,"|");
cetak(8+i,57,"Bayar");
cetak(8+i,69,"|");
cetak(8+i,80,"|");
cetak(9+i,2,"|");
cetak(9+i,57,"Kembali");
cetak(9+i,69,"|");
cetak(9+i,80,"|");
cetak(10+i,2,"===============================================================================");
}
void isidata()
{
int i=1;
char nmbrg[30];
int jmlbl,hgsat,jmlhg,diskon,jmldiskon;
//do{
gotoxy(5,6+i);cout<<i;
gotoxy(10,6+i);cin>>nmbrg;
gotoxy(31,6+i);cin>>jmlbl;
gotoxy(42,6+i);cin>>hgsat;
jmlhg=hi_jmlhg(jmlbl,hgsat);
gotoxy(52,6+i);cout<<jmlhg;
gotoxy(62,6+i);cout<<diskon;
jmldiskon=hi_diskon(diskon,jmlhg);
gotoxy(62,6+i);cout<<jmldiskon;
hgbyr=hi_hgbyr(jmlhg,jmldiskon);
gotoxy(71,6+i);cout<<hgbyr;
//}while(jw=="y");
}
void main(){ //menu utama
header();
isi();
isidata();
getch();
}
#include <conio.h>
void cetak(int klm, int brs, char *teks)
{
gotoxy(brs,klm);cout<<teks;
}
void cetakc(int brs, char *teks)
{
gotoxy(40-(strlen(teks)/2),brs);cout<<teks;
}
int hi_jmlhg(int a,int b)
{
return(a*b);
}
float hi_diskon(int d, int jml)
{
return((d/100)*jml);
}
float hi_hgbyr
void header(){
cetakc(1,"TOKO MAJU MUNDUR SEJATI");
cetakc(2,"Jln Godean Km. 6,5");
cetak(4,2,"===============================================================================");
cetak(5,2,"|");
cetak(5,4,"No.");
cetak(5,8,"|");
cetak(5,12,"Nama Barang");
cetak(5,26,"|");
cetak(5,28,"Jml Beli");
cetak(5,37,"|");
cetak(5,39,"Hrg Satuan");
cetak(5,50,"|");
cetak(5,52,"jml Hrg");
cetak(5,60,"|");
cetak(5,62,"Diskon");
cetak(5,69,"|");
cetak(5,71,"Hg Bayar");
cetak(5,80,"|");
cetak(6,2,"===============================================================================");
}
void isi()
{
int i;
for(i=1;i<=10;i++)
{
cetak(6+i,2,"|");
cetak(6+i,8,"|");
cetak(6+i,26,"|");
cetak(6+i,37,"|");
cetak(6+i,50,"|");
cetak(6+i,60,"|");
cetak(6+i,69,"|");
cetak(6+i,80,"|");
}
cetak(6+i,2,"===============================================================================");
cetak(7+i,2,"|");
cetak(7+i,57,"Total Harga");
cetak(7+i,69,"|");
cetak(7+i,80,"|");
cetak(8+i,2,"|");
cetak(8+i,57,"Bayar");
cetak(8+i,69,"|");
cetak(8+i,80,"|");
cetak(9+i,2,"|");
cetak(9+i,57,"Kembali");
cetak(9+i,69,"|");
cetak(9+i,80,"|");
cetak(10+i,2,"===============================================================================");
}
void isidata()
{
int i=1;
char nmbrg[30];
int jmlbl,hgsat,jmlhg,diskon,jmldiskon;
//do{
gotoxy(5,6+i);cout<<i;
gotoxy(10,6+i);cin>>nmbrg;
gotoxy(31,6+i);cin>>jmlbl;
gotoxy(42,6+i);cin>>hgsat;
jmlhg=hi_jmlhg(jmlbl,hgsat);
gotoxy(52,6+i);cout<<jmlhg;
gotoxy(62,6+i);cout<<diskon;
jmldiskon=hi_diskon(diskon,jmlhg);
gotoxy(62,6+i);cout<<jmldiskon;
hgbyr=hi_hgbyr(jmlhg,jmldiskon);
gotoxy(71,6+i);cout<<hgbyr;
//}while(jw=="y");
}
void main(){ //menu utama
header();
isi();
isidata();
getch();
}