#include <stdio.h>
#include
<conio.h>
#include
<iostream.h>
main ()
{
char
jwb,kd,kdkls,*nmkereta,*tujuan,*kelas;
int jmlbeli,harga;
float total;
a:
clrscr();
cout<<" DATA
PEMESANAN TIKET
"<<endl<<endl;
cout<<"
Jumlah Tiket Yang Dibeli : ";cin>>jmlbeli;
cout<<endl;
cout<<"
[--DAFTAR PILIHAN BUKU--] "<<endl;
cout<<endl;
cout<<"A. Argo Bromo
"<<endl;
cout<<" -->
Tujuan : Jkt - Bandung"<<endl;
cout<<" Kode Kelas :
"<<endl;
cout<<"
1. Eksekutif Rp. 150.000 "<<endl;
cout<<"
2. Bisnis Rp. 90.000 "<<endl;
cout<<"
3. Ekonomi Rp. 50.000 "<<endl;
cout<<"B. Senja Utama
"<<endl;
cout<<" -->
Tujuan : Jkt - Yogya"<<endl;
cout<<" Kode Kelas :
"<<endl;
cout<<"
1. Eksekutif Rp. 300.000 "<<endl;
cout<<"
2. Bisnis Rp. 175.000
"<<endl;
cout<<" 3.
Ekonomi Rp. 70.000 "<<endl<<endl;
cout<<"
Masukkan Kode Kereta :
";cin>>kd;
cout<<"
Masukkan Kode Kelas :
";cin>>kdkls;
if(kd=='A'||kd=='a')
{
nmkereta="Argo Bromo";
tujuan="Jkt -
Bandung";
if(kdkls=='1')
{
kelas="Eksekutif";
harga=150000;
}
else
if(kdkls=='2')
{
kelas="Bisnis";
harga=90000;
}
else
{
kelas="Ekonomi";
harga=50000;
}
}
else
{
nmkereta="Senja Utama";
tujuan="Jkt -
Yogya";
if(kdkls=='1')
{
kelas="Eksekutif";
harga=300000;
}
else
if(kdkls=='2')
{
kelas="Bisnis";
harga=175000;
}
else
{
kelas="Ekonomi";
harga=70000;
}
}
total=harga*jmlbeli;
clrscr();
cout<<"PENJUALAN TIKET KERETA
API"<<endl;
cout<<"
Kode Kereta :
"<<kd<<endl;
cout<<"
Nama Kereta : "<<nmkereta<<endl;
cout<<"
TUjuan :
"<<tujuan<<endl;
cout<<"
Kode Kelas :
"<<kdkls<<endl;
cout<<"
Kelas :
"<<kelas<<endl;
cout<<"
Harga :
"<<harga<<endl;
cout<<"
Jumlah Beli :
"<<jmlbeli<<endl;
cout<<"
Total Bayar : "<<total<<endl;
cout<<"\nMau input lagi [Y/T]
?";cin>>jwb;
if(jwb=='y'||jwb=='Y')
goto a;
else
cout<<"\nTerima Kasih....";
getch();
}
#include <stdio.h>
#include
<conio.h>
#include
<iostream.h>
main ()
{
char
jwb,grade[2],nim[8],nm[20],ket[10];
float
ntgs,nabsen,nuts,nuas,rata;
a:
clrscr();
cout<<" LPK BINA LAKSANA"<<endl;
cout<<"Jl.
Sejahtera I No. 100"<<endl;
cout<<"========================"<<endl<<endl;
cout<<
"NIM =
";cin>>nim;
printf("Nama = ");gets(nm);
cout<<"Nilai Absen = ";cin>>nabsen;
cout<<"Nilai Tugas = ";cin>>ntgs;
cout<<"Nilai UTS = ";cin>>nuts;
cout<<"Nilai UAS = ";cin>>nuas;
rata=(0.1*nabsen)+(0.2*ntgs)+(0.3*nuts)+(0.4*nuas);
if(rata>=85)
{
strcpy(grade,"A");
strcpy(ket,"OK");
}
else
if(rata>=75)
{
strcpy(grade,"B");
strcpy(ket,"Baik");
}
else
if(rata>=60)
{
strcpy(grade,"C");
strcpy(ket,"Cukup");
}
else
if(rata>=45)
{
strcpy(grade,"D");
strcpy(ket,"Kurang");
}
else
{
strcpy(grade,"E");;
strcpy(ket,"Hancur");
}
clrscr();
cout<<" LPK BINA LAKSANA"<<endl;
cout<<"Jl.
Sejahtera I No. 100"<<endl;
cout<<"========================"<<endl<<endl;
cout<<"NIM = "<<nim<<endl;
cout<<"Nama = "<<nm<<endl;
cout<<"========================"<<endl<<endl;
cout<<"Nilai Absen = "<<nabsen<<endl;
cout<<"Nilai Tugas = "<<ntgs<<endl;
cout<<"Nilai UTS = "<<nuts<<endl;
cout<<"Nilai UAS = "<<nuas<<endl;
cout<<"========================"<<endl<<endl;
cout<<"Nilai Rata-rata = "<<rata<<endl;
cout<<"Grade Anda = "<<grade<<endl;
cout<<"Keterangan =
"<<ket<<endl<<endl;
cout<<"\nMau input lagi [Y/T]
?";cin>>jwb;
if(jwb=='y'||jwb=='Y')
goto a;
else
cout<<"\nTerima Kasih....";
getch();
}
Jawaban 1 Menggunakan strcpy
#include
<stdio.h>
#include
<conio.h>
#include
<iostream.h>
main ()
{
char
jwb,grade,nim[8],nm[20],*ket;
float
ntgs,nabsen,nuts,nuas,rata;
a:
clrscr();
cout<<" LPK BINA LAKSANA"<<endl;
cout<<"Jl.
Sejahtera I No. 100"<<endl;
cout<<"========================"<<endl<<endl;
cout<<"NIM = ";cin>>nim;
printf("Nama =
");gets(nm);
cout<<"Nilai Absen = ";cin>>nabsen;
cout<<"Nilai
Tugas = ";cin>>ntgs;
cout<<"Nilai UTS = ";cin>>nuts;
cout<<"Nilai UAS = ";cin>>nuas;
rata=(0.1*nabsen)+(0.2*ntgs)+(0.3*nuts)+(0.4*nuas);
if(rata>=85)
{
grade='A';
ket ="OK";
}
else
if(rata>=75)
{
grade='B';
ket ="Baik";
}
else
if(rata>=60)
{
grade='C';
ket ="Cukup";
}
else
if(rata>=45)
{
grade='D';
ket ="Kurang";
}
else
{
grade='E';
ket ="Hancur";
}
clrscr();
cout<<" LPK BINA LAKSANA"<<endl;
cout<<"Jl.
Sejahtera I No. 100"<<endl;
cout<<"========================"<<endl<<endl;
cout<<"NIM = "<<nim<<endl;
cout<<"Nama = "<<nm<<endl;
cout<<"========================"<<endl<<endl;
cout<<"Nilai Absen = "<<nabsen<<endl;
cout<<"Nilai Tugas = "<<ntgs<<endl;
cout<<"Nilai UTS = "<<nuts<<endl;
cout<<"Nilai UAS = "<<nuas<<endl;
cout<<"========================"<<endl<<endl;
cout<<"Nilai Rata-rata = "<<rata<<endl;
cout<<"Grade Anda = "<<grade<<endl;
cout<<"Keterangan = "<<ket<<endl<<endl;
cout<<"\nMau input lagi [Y/T]
?";cin>>jwb;
if(jwb=='y'||jwb=='Y')
goto a;
else
cout<<"\nTerima Kasih....";
getch();
}
Jawaban 2 tanpa strcpy
#include <stdio.h>
#include <conio.h>
#include <iostream.h>
main ()
{
char jwb,grade,nim[8],nm[20],*ket;
float ntgs,nabsen,nuts,nuas,rata;
a:
clrscr();
cout<<"
LPK BINA LAKSANA"<<endl;
cout<<"Jl. Sejahtera I No. 100"<<endl;
cout<<"========================"<<endl<<endl;
cout<<"NIM
= ";cin>>nim;
printf("Nama
= ");gets(nm);
cout<<"Nilai Absen = ";cin>>nabsen;
cout<<"Nilai Tugas = ";cin>>ntgs;
cout<<"Nilai UTS = ";cin>>nuts;
cout<<"Nilai UAS = ";cin>>nuas;
rata=(0.1*nabsen)+(0.2*ntgs)+(0.3*nuts)+(0.4*nuas);
if(rata>=85)
{
grade='A';
ket ="OK";
}
else if(rata>=75)
{
grade='B';
ket ="Baik";
}
else
if(rata>=60)
{
grade='C';
ket ="Cukup";
}
else
if(rata>=45)
{
grade='D';
ket ="Kurang";
}
else
{
grade='E';
ket ="Hancur";
}
clrscr();
cout<<"
LPK BINA LAKSANA"<<endl;
cout<<"Jl. Sejahtera I No. 100"<<endl;
cout<<"========================"<<endl<<endl;
cout<<"NIM
= "<<nim<<endl;
cout<<"Nama
= "<<nm<<endl;
cout<<"========================"<<endl<<endl;
cout<<"Nilai Absen = "<<nabsen<<endl;
cout<<"Nilai Tugas = "<<ntgs<<endl;
cout<<"Nilai UTS = "<<nuts<<endl;
cout<<"Nilai UAS = "<<nuas<<endl;
cout<<"========================"<<endl<<endl;
cout<<"Nilai Rata-rata = "<<rata<<endl;
cout<<"Grade Anda = "<<grade<<endl;
cout<<"Keterangan =
"<<ket<<endl<<endl;
cout<<"\nMau input lagi [Y/T]
?";cin>>jwb;
if(jwb=='y'||jwb=='Y')
goto a;
else
cout<<"\nTerima Kasih....";
getch();
}
#include<conio.h>
#include<stdio.h>
#include<iostream.h>
main()
{
char
npem[20],kdpes,*npes;
float
jbtk,disk,hrg,ppn;
long int jb,tot;
cout<<" Program Penjualan
tiket"<<endl;
cout<<" Bandara Sri
Sultan"<<endl;
cout<<"================================================="<<endl;
cout<<"Daftar kode
pesawat:"<<endl;
cout<<"
kode pesawat nama pesawat harga"<<endl;
cout<<" 1
Garuda
RP.250000"<<endl;
cout<<" 2
Mandala
Rp.180000"<<endl;
cout<<" 3
Lion Air
Rp.275000"<<endl;
cout<<" 4
Merpati
Rp.165000"<<endl;
cout<<"=================================================="<<endl;
cout<<"Masukan Nama penumpang =";cin>>npem;
cout<<"Masukan Kode Pesawat
[1/2/3/4]=";cin>>kdpes;
cout<<"Jumlah Beli Tiket =";cin>>jbtk;
clrscr();
switch (kdpes)
{
case '1':
{
npes="Garuda";
hrg=250000;
}
break;
case '2':
{
npes="Mandala";
hrg=180000;
}
break;
case '3':
{
npes="Lion
Air";
hrg=275000;
}
break;
default:
{
npes="Merpati";
hrg=165000;
}
break;
}
cout<<"Program Penjualan
tket"<<endl;
cout<<" Bandara Sri Sultan"<<endl;
cout<<"========================"<<endl;
cout<<"Nama penumpang ="<<npem<<endl;
cout<<"Kode pesawat ="<<kdpes<<endl;
cout<<"Harga =Rp."<<hrg<<endl;
cout<<"Jumlah beli tiket
="<<jbtk<<endl;
cout<<"Nama pesawat ="<<npes<<endl;
jb=jbtk*hrg;
cout<<"Jumlah Bayar =Rp."<<jb<<endl;
if (jbtk>5)
disk=0.05*jb;
else
disk=0 ;
ppn=0.1*jb;
cout<<"PPN =Rp."<<ppn<<endl;
cout<<"Diskon =Rp."<<disk<<endl;
tot=jb-disk;
cout<<"========================="<<endl;
cout<<"Total Bayar =Rp."<<tot<<endl;
getch();
}
//Listing Program
//INPUT
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
garis()
{cout<<"
======================================================================="<<endl;}
struct
{
char
kode[3],kelas[3],*nk;
long int
harga,lm,pajak,total;
}klinik[5];
main()
{
char
pemesan[20],alm[30],lagi;
long int
i,j,totkes=0,pot,dibayar,ubay,ukem;
clrscr();
atas:
cout<<"Pemesan = ";gets(pemesan);
cout<<"Alamat = ";gets(alm);
cout<<"Jumlh Ambil Kamar =
";cin>>j;
garis();
for(i=1;i<=j;i++)
{
cout<<"Kode
Kamar [AG/MW/FL] = ";cin>>klinik[i].kode;
cout<<"Kelas Kamar [I/II] = ";cin>>klinik[i].kelas;
if(!strcmp(klinik[i].kode,"AG")||!strcmp(klinik[i].kode,"ag"))
{klinik[i].nk="Anggrek";
if(!strcmp(klinik[i].kelas,"I")||!strcmp(klinik[i].kelas,"i"))
{klinik[i].harga=550000;}
else
{klinik[i].harga=450000;}
}
else
if(!strcmp(klinik[i].kode,"MW")||!strcmp(klinik[i].kode,"mw"))
{klinik[i].nk="Mawar";
if(!strcmp(klinik[i].kelas,"I")||!strcmp(klinik[i].kelas,"i"))
{klinik[i].harga=350000;}
else
{klinik[i].harga=250000;}
}
else
{klinik[i].nk="Flamboyan";
if(!strcmp(klinik[i].kelas,"I")||!strcmp(klinik[i].kelas,"i"))
{klinik[i].harga=150000;}
else
{klinik[i].harga=75000;}
}
cout<<"Lama Inap = ";cin>>klinik[i].lm;
if(klinik[i].lm>=10)
{klinik[i].pajak=0.1*klinik[i].harga;}
else
{klinik[i].pajak=0;}
klinik[i].total=(klinik[i].harga*klinik[i].lm)+klinik[i].pajak;
totkes=totkes+klinik[i].total;
if(totkes>=8000000)
pot=0.1*totkes;
else
pot=0;
dibayar=totkes-pot;
}
clrscr();
//OUTPUT
cout<<"KLINIK SEHAT WAL'AFIAT
SEJAHTERA"<<endl;
garis();
cout<<"Pemesan = "<<pemesan<<endl;
cout<<"Alamat = "<<alm<<endl;
garis();
cout<<"No Kode
Kelas Lama Harga
Pajak Total"<<endl;
garis();
for(i=1;i<=j;i++)
{
gotoxy(2,8+i);cout<<i;
gotoxy(6,8+i);cout<<klinik[i].kode;
gotoxy(13,8+i);cout<<klinik[i].kelas;
gotoxy(21,8+i);cout<<klinik[i].lm;
gotoxy(29,8+i);cout<<klinik[i].harga;
gotoxy(38,8+i);cout<<klinik[i].pajak;
gotoxy(48,8+i);cout<<klinik[i].total<<endl;}
garis();
cout<<"Total Keseluruhan =
"<<totkes<<endl;
cout<<"Potongan 10% = "<<pot<<endl;
cout<<"Dibayar = "<<dibayar<<endl;
cout<<"Uang Bayar = ";cin>>ubay;
ukem=ubay-dibayar;
cout<<"Uang Kembali =
"<<ukem<<endl<<endl;
garis();
cout<<"\nInput Data Lagi[Y/N]=
";cin>>lagi;
if(lagi=='Y'||lagi=='y')
goto atas;
else
clrscr();
cout<<"Terima Kasih . . . . .
"<<endl;
getch();
}
//Listing Program
//INPUT
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
garis()
{cout<<"
======================================================================="<<endl;}
long int total(long
int harga,long int diskon)
{long int
total(harga-diskon);return (total);}
struct
{
char
kode[3],*np,*jp,jk[3],*kelas;
long int
hrg,dis,hasil;
}klinik[5];
main()
{
char
siswa[20],th[10],*bonus,lagi;
long int
i,j,totkes=0,ubay,ukem;
clrscr();
atas:
cout<<"siswa = ";gets(siswa);
cout<<"Tahun Ajaran = ";gets(th);
cout<<"Jumlh Ambil Paket =
";cin>>j;
garis();
for(i=1;i<=j;i++)
{
cout<<"Kode Kursus [P1/P2/P3] =
";cin>>klinik[i].kode;
cout<<"Kelas [I.Pagi/II.Malam]=
";cin>>klinik[i].jk;
if(!strcmp(klinik[i].kode,"P1")||!strcmp(klinik[i].kode,"p1"))
{klinik[i].np="Paket 1";
klinik[i].jp="Office";
if(!strcmp(klinik[i].jk,"I")||!strcmp(klinik[i].jk,"i"))
{klinik[i].kelas="Pagi";
klinik[i].hrg=250000;}
else
{klinik[i].kelas="Malam";
klinik[i].hrg=300000;}
klinik[i].dis=0.05*klinik[i].hrg;}
else
if(!strcmp(klinik[i].kode,"P2")||!strcmp(klinik[i].kode,"p2"))
{klinik[i].np="Paket 2";
klinik[i].jp="Web Programming";
if(!strcmp(klinik[i].jk,"I")||!strcmp(klinik[i].jk,"i"))
{klinik[i].kelas="Pagi";
klinik[i].hrg=300000;}
else
{klinik[i].kelas="Malam";
klinik[i].hrg=325000;}
klinik[i].dis=0.1*klinik[i].hrg;}
else
{klinik[i].np="Paket 3";
klinik[i].jp="Jaringan";
if(!strcmp(klinik[i].jk,"I")||!strcmp(klinik[i].jk,"i"))
{klinik[i].kelas="Pagi";
klinik[i].hrg=400000;}
else
{klinik[i].kelas="Malam";
klinik[i].hrg=450000;}
klinik[i].dis=0.15*klinik[i].hrg;}
klinik[i].hasil=total(klinik[i].hrg,klinik[i].dis);
totkes=totkes+klinik[i].hasil;
}
clrscr();
//OUTPUT
cout<<"\t\t\tLPK \"Bina
Bangsa\""<<endl;
garis();
cout<<"Siswa = "<<siswa<<endl;
cout<<"Tahun Ajaran = "<<th<<endl;
garis();
cout<<"No Paket
Jenis Kelas Harga
Diskon
Total"<<endl;
garis();
for(i=1;i<=j;i++)
{
gotoxy(2,7+i);cout<<i;
gotoxy(5,7+i);cout<<klinik[i].np;
gotoxy(13,7+i);cout<<klinik[i].jp;
gotoxy(32,7+i);cout<<klinik[i].kelas;
gotoxy(40,7+i);cout<<klinik[i].hrg;
gotoxy(49,7+i);cout<<klinik[i].dis;
gotoxy(60,7+i);cout<<klinik[i].hasil<<endl;}
garis();
cout<<"Total Keseluruhan =
"<<totkes<<endl;
if(totkes>=700000)
{bonus="Tas
Ransel";}
else
if(totkes>=600000)
{bonus="Modul
Materi";}
else
if(totkes>=500000)
{bonus="Kaos
Bina Bangsa";}
else
{bonus="Kalender";}
cout<<"Bonus = "<<bonus<<endl;
cout<<"Uang Bayar = ";cin>>ubay;
ukem=ubay-totkes;
cout<<"Uang Kembali =
"<<ukem<<endl<<endl;
garis();
cout<<"\nInput
Data Lagi[Y/N]= ";cin>>lagi;
if(lagi=='Y'||lagi=='y')
goto atas;
else
clrscr();
cout<<"Terima Kasih . . . . .
"<<endl;
getch();
}
//Listing Program
//INPUT
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
judul()
{cout<<"\t\tZapora's
Printing"<<endl;
cout<<"Jl.Fatmawati No.26 Pondok
Labu Jakarta Selatan"<<endl;}
garis()
{cout<<"
======================================================================="<<endl;}
struct
{
char
kode[5],*nj,kk,*jk;
long int
harga,jc,tothar;
}cetak[5];
main()
{
char
tgl[20],kasir[20],lagi;
long int
i,j,totbay=0,ubay,ukem;
clrscr();
atas:
judul();
garis();
cout<<"Tanggal = ";gets(tgl);
cout<<"Kasir = ";gets(kasir);
cout<<"Jumlah
Jasa = ";cin>>j;
garis();
for(i=1;i<=j;i++)
{cout<<"Data ke-
"<<i<<endl;
cout<<"Masukkan Kode Jasa
[Y001/K002/P003] = ";cin>>cetak[i].kode;
cout<<"Masukkan Jenis Kertas
[T/S/B] =
";cin>>cetak[i].kk;
cout<<"Masukkan Jumlah Cetak = ";cin>>cetak[i].jc;
if(!strcmp(cetak[i].kode,"Y001")||!strcmp(cetak[i].kode,"y001"))
{cetak[i].nj="Yasin";
if(cetak[i].kk=='T'||cetak[i].kk=='t')
{cetak[i].jk="Kertas Tebal";
cetak[i].harga=18000;}
else
if(cetak[i].kk=='S'||cetak[i].kk=='s')
{cetak[i].jk="Kertas Sedang";
cetak[i].harga=12000;}
else
{cetak[i].jk="Kertas Biasa";
cetak[i].harga=8000;}
}
else
if(!strcmp(cetak[i].kode,"K002")||!strcmp(cetak[i].kode,"k002"))
{cetak[i].nj="Kartu Nama";
if(cetak[i].kk=='T'||cetak[i].kk=='t')
{cetak[i].jk="Kertas Tebal";
cetak[i].harga=6000;}
else
if(cetak[i].kk=='S'||cetak[i].kk=='s')
{cetak[i].jk="Kertas Sedang";
cetak[i].harga=3000;}
else
{cetak[i].jk="Kertas Biasa";
cetak[i].harga=2000;}
}
else
{cetak[i].nj="Pamflet";
if(cetak[i].kk=='T'||cetak[i].kk=='t')
{cetak[i].jk="Kertas Tebal";
cetak[i].harga=20000;}
else
if(cetak[i].kk=='S'||cetak[i].kk=='s')
{cetak[i].jk="Kertas Sedang";
cetak[i].harga=10000;}
else
{cetak[i].jk="Kertas Biasa";
cetak[i].harga=5000;}
}
cetak[i].tothar=cetak[i].jc*cetak[i].harga;
totbay=totbay+cetak[i].tothar;
}
clrscr();
//OUTPUT
judul();
garis();
cout<<"Tanggal = "<<tgl;
cout<<"\t\t\tKasir = "<<kasir<<endl;
garis();
cout<<"No Nama Jasa
Jenis Kertas Jumlah Cetak Harga
Total Harga"<<endl;
garis();
for(i=1;i<=j;i++)
{
gotoxy(2,7+i);cout<<i;
gotoxy(5,7+i);cout<<cetak[i].nj;
gotoxy(18,7+i);cout<<cetak[i].jk;
gotoxy(33,7+i);cout<<cetak[i].jc;
gotoxy(48,7+i);cout<<cetak[i].harga;
gotoxy(58,7+i);cout<<cetak[i].tothar<<endl;}
garis();
cout<<"\t\t\t\tTotal Bayar = "<<totbay<<endl;
cout<<"\t\t\t\tUang Bayar = ";cin>>ubay;
ukem=ubay-totbay;
cout<<"\t\t\t\tUang Kembali =
"<<ukem<<endl<<endl;
garis();
cout<<"\nInput Data Lagi[Y/N]=
";cin>>lagi;
if(lagi=='Y'||lagi=='y')
goto atas;
else
clrscr();
cout<<"Terima Kasih . . . . .
"<<endl;
getch();
}
//Listing Program
//INPUT
#include<stdio.h>
#include<conio.h>
#include<iostream.h>
judul()
{cout<<"\t\t\tToserba Kaze
Kage"<<endl;
cout<<"~~~~~~~~~~********************======********************~~~~~~~~~~"<<endl;}
garis()
{cout<<"
======================================================================="<<endl;}
struct
{
char
kode[5],*nb,uk[3];
long int
harga,pajak,jumbel,total;
}toserba[5];
main()
{
char
alm[20],pemesan[20],lagi;
long int
i,j,dibayar,pot,totkes=0,ubay,ukem;
clrscr();
atas:
clrscr();
judul();
cout<<"Pemesan = ";gets(pemesan);
cout<<"Alamat = ";gets(alm);
cout<<"Jumlah Ambil Barang =
";cin>>j;
garis();
for(i=1;i<=j;i++)
{
cout<<"Kode Barang [BJA/SFD/MIN] =
";cin>>toserba[i].kode;
cout<<"Ukuran [I/II] = ";cin>>toserba[i].uk;
cout<<"Jumlah Beli =
";cin>>toserba[i].jumbel;
if(!strcmp(toserba[i].kode,"BJA")||!strcmp(toserba[i].kode,"bja"))
{toserba[i].nb="Baju Anak";
if(toserba[i].uk=="I"||toserba[i].uk=="i")
{toserba[i].harga=200000;}
else
{toserba[i].harga=400000;}}
else
if(!strcmp(toserba[i].kode,"SFD")||!strcmp(toserba[i].kode,"sfd"))
{toserba[i].nb="Soft Drink";
if(toserba[i].uk=="I"||toserba[i].uk=="i")
{toserba[i].harga=300000;}
else
{toserba[i].harga=500000;}}
else
{toserba[i].nb="Baju Anak";
if(toserba[i].uk=="I"||toserba[i].uk=="i")
{toserba[i].harga=500000;}
else
{toserba[i].harga=700000;}}
if(toserba[i].jumbel>=10)
toserba[i].pajak=0.1*toserba[i].harga;
toserba[i].total=(toserba[i].harga*toserba[i].jumbel)+toserba[i].pajak;
totkes=totkes+toserba[i].total;
if(totkes>=7000000)
pot=0.1*totkes;
else
pot=0;
dibayar=totkes-pot;
}
clrscr();
//OUTPUT
judul();
cout<<"
Pemesan =
"<<pemesan<<endl;
cout<<"
Alamat =
"<<alm<<endl;
garis();
cout<<"No Kode
Nama Barang Ukuran Harga
Jumlah Beli Pajak Total "<<endl;
garis();
for(i=1;i<=j;i++)
{
gotoxy(2,7+i);cout<<i;
gotoxy(6,7+i);cout<<toserba[i].kode;
gotoxy(13,7+i);cout<<toserba[i].nb;
gotoxy(28,7+i);cout<<toserba[i].uk;
gotoxy(37,7+i);cout<<toserba[i].harga;
gotoxy(47,7+i);cout<<toserba[i].jumbel;
gotoxy(58,7+i);cout<<toserba[i].pajak;
gotoxy(66,7+i);cout<<toserba[i].total<<endl;}
garis();
cout<<"\t\t\t\tTotal
Keseluruhan =
"<<totkes<<endl;
cout<<"\t\t\t\tPotongan 10% = "<<pot<<endl;
cout<<"\t\t\t\tDibayar =
"<<dibayar<<endl;
cout<<"\t\t\t\tUang Bayar = ";cin>>ubay;
ukem=ubay-dibayar;
cout<<"\t\t\t\tUang Kembali =
"<<ukem<<endl<<endl;
garis();
cout<<"\nInput Data Lagi[Y/N]=
";cin>>lagi;
if(lagi=='Y'||lagi=='y')
goto atas;
else
clrscr();
cout<<"Terima Kasih . . . . .
"<<endl;
getch();
}
Tidak ada komentar:
Posting Komentar