TUGAS E
#include
#include
#include
#include
char *nm(char nip[9])
{
if(!strcmp(nip,"13540121"))
{return "Eva Melinda, S.Kom";}
else if(!strcmp(nip,"13540424"))
{return "Ade Hendini, S.Kom";}
else if(!strcmp(nip,"13540488"))
{return "Deni Maulana, ST";}
else if(!strcmp(nip,"13540773"))
{return "Abduyl Majid, S.Si";}
else if(!strcmp(nip,"13540999"))
{return "Desy R. Sari, M.Msi";}
}
char *gol(char nip[8])
{
if(!strcmp(nip,"13540121"))
{return "I";}
else if(!strcmp(nip,"13540424"))
{return "I";}
else if(!strcmp(nip,"13540488"))
{return "II";}
else if(!strcmp(nip,"13540773"))
{return "II";}
else if(!strcmp(nip,"13540999"))
{return "III";}
}
main()
{
class
{
public:
char nip[9];
int jam,hnr,ttl;
}guru[10];
int i,j;
long int tokes=0;
clrscr();
cout<<"=============================================="<
for(i=1;i<=j;i++)
{
cout<
cout<<"Nama : "<
{guru[i].hnr=15000;}
else if(!strcmp(gol(guru[i].nip),"II"))
{guru[i].hnr=26500;}
else if(!strcmp(gol(guru[i].nip),"III"))
{guru[i].hnr=88000;}
cout<<"Jumlah Jam Mengajar : ";cin>>guru[i].jam;
guru[i].ttl=guru[i].hnr*guru[i].jam;
tokes=tokes+guru[i].ttl;
}
clrscr();
cout<<"========================================================================="<
{
cout<
cout<<"======================================================================="<
}
16.15 | | 0 Comments
TUGAS D
#include
#include
#include
#include
char *grade(char ttl)
{
if(ttl>80)
{return "A";}
else if(ttl>70)
{return "B";}
else if(ttl>60)
{return "C";}
else if(ttl>50)
{return "D";}
else
{return "E";}
}
char *mk(char kd[4])
{
if(!strcmp(kd, "151"))
{return "Algoritma dan Pemrograman 1";}
else if(!strcmp(kd, "422"))
{return "linux 1";}
else if(!strcmp(kd, "733"))
{return "PPN II(Access)";}
else if(!strcmp(kd, "772"))
{return "DBMS";}
}
main()
{
struct
{
char nim[8],nm[20];
int prs,tgs,uts,uas,ttl;
}nilai[10];
int i,j;
char kd[4];
clrscr();
cout<<"=========================================="<
cout<<"Jumlah Data Mahasiswa :";cin>>j;
for(i=1;i<=j;i++)
{
cout<
cout<<"Nama :";cin>>nilai[i].nm;
cout<<"Nilai Presensi :";cin>>nilai[i].prs;
cout<<"Nilai Tugas :";cin>>nilai[i].tgs;
cout<<"Nilai UTS :";cin>>nilai[i].uts;
cout<<"Nilai UAS :";cin>>nilai[i].uas;
nilai[i].ttl=(0.1*nilai[i].prs)+(0.2*nilai[i].tgs)+(0.3*nilai[i].uts)+(0.4*nilai[i].uas);
}
clrscr();
cout<<"Kode Mata Kuliah :"<
{
cout<
cout<<"=========================================================================="<
}
15.56 | | 0 Comments
TUGAS C
#include
#include
#include
#include
char *pkt(char kode[6])
{
if(!strcmp(kode,"B-01"))
{return "Cheese Burger";}
else if(!strcmp(kode,"B-02"))
{return "Beef Burger";}
else if(!strcmp(kode,"B-SPC"))
{return "Special Burger";}
else if(!strcmp(kode,"P-M"))
{return "Pizza Medium Size";}
else if(!strcmp(kode,"P-S"))
{return "Pizza Small Size";}
else if(!strcmp(kode,"P-SPC"))
{return "Special Pizza";}
else if(!strcmp(kode,"D-C"))
{return "Soft Drink Cola";}
else if(!strcmp(kode,"D-J"))
{return "Soft Drink Juice";}
}
long int hrg(char kode[6])
{
if(!strcmp(kode,"B-01"))
{return 5500;}
else if(!strcmp(kode,"B-02"))
{return 7500;}
else if(!strcmp(kode,"B-SPC"))
{return 11000;}
else if(!strcmp(kode,"P-M"))
{return 24000;}
else if(!strcmp(kode,"P-S"))
{return 9000;}
else if(!strcmp(kode,"P-SPC"))
{return 75500;}
else if(!strcmp(kode,"D-C"))
{return 4500;}
else if(!strcmp(kode,"D-J"))
{return 3500;}
}
main()
{
struct
{
char kode[6];
int jml;
long int toha;
}bp[10];
float subtotal=0,ppn,grand,bayar,kbl;
int i,j;
int nota;
clrscr();
cout<<"===================================================="<
cout<<"Jumlah Transaksi : ";cin>>j;
for(i=1;i<=j;i++)
{
cout<
cout<<"Nama Paket : "<
bp[i].toha=hrg(bp[i].kode)*bp[i].jml;
cout<<"Total Harga : "<
ppn=0.1*subtotal;
grand=subtotal+ppn;
}
clrscr();
cout<<"===================================================="<
{
cout<
cout<<"=================================================="<
kbl=bayar-grand;
cout<<" Kembalian :Rp."<
getch();
}
15.50 | | 0 Comments
TUGAS B
#include
#include
#include
#include
main()
{
class
{
public:
char nm[20];
long int harga,toha;
int jumbel;
}penj[10];
float subtotal=0,disc,ppn,grand,bayar,kbl;
int nota;
int i,j;
char lagi;
clrscr();
cout<<"============================================="<
cout<<"Jumlah Transaksi : ";cin>>j;
for(i=1;i<=j;i++)
{
cout<
cout<<"Harga Satuan : ";cin>>penj[i].harga;
cout<<"Jumlah Beli : ";cin>>penj[i].jumbel;
penj[i].toha=penj[i].harga*penj[i].jumbel;
cout<<"Total Harga : "<
if(subtotal>180000)
{disc=0.15*subtotal;}
else if(subtotal>70000)
{disc=0.05*subtotal;}
else
{disc=0;}
ppn=0.1*(subtotal-disc);
grand=(subtotal-disc)+ppn;
}
clrscr();
cout<<" SWALAYAN BINA DAGANG"<
{
cout<
cout<<"============================="<
cout<<"-----------------------------"<
cout<<" Kembalian : Rp."<
}
15.25 | | 0 Comments
TUGAS A
#include
#include
#include
#include
struct
{
char nk,jns,*nl;
int trf,dur,ttl;
}rental[20];
long int tokes=0;
main()
{
int i,j;
char lagi;
atas:
clrscr();
cout<<"================================================="<
cout<
{
cout<<"Transaksi Ke - "<cout<<"No. Komputer :";cin>>rental[i].nk;
cout<<"Jenis Layanan :";cin>>rental[i].jns;
if(rental[i].jns=='A'||rental[i].jns=='a')
{rental[i].nl="Internet";rental[i].trf=2500;}
else if(rental[i].jns=='B'||rental[i].jns=='b')
{rental[i].nl="Game Online";rental[i].trf=3000;}
else if(rental[i].jns=='C'||rental[i].jns=='c')
{rental[i].nl="Game Offline";rental[i].trf=2000;}
else if(rental[i].jns=='D'||rental[i].jns=='d')
{rental[i].nl="Rental Pengetikan";rental[i].trf=1500;}
cout<<"Tarif Permenit :"<
rental[i].ttl=rental[i].trf*rental[i].dur;
tokes=tokes+rental[i].ttl;
cout<
clrscr();
cout<<"================================================="<
{
cout<
cout<<"================================================="<
cout<<"Return :";cin>>lagi;
if (lagi=='Y' || lagi=='y')
goto atas;
else
getch();
}
14.48 | | 0 Comments