Minggu, 05 Mei 2013

Borlan C++ Nilai Presentasi


#include<iostream>
#include<conio>
#include<stdio>
#include <stdlib>
main(){
char cb;
int pil,nilai ;
float presentasi,p_m,p_p,d_m,t_j ;
back:
cout<<"[1] Kurang"<<endl;
cout<<"[2] Sedang"<<endl;
cout<<"[3] Baik"<<endl;
cout<<"==========="<<endl;
B:
cout<<"masukan nilai presentasi anda : ";cin>>pil;
switch (pil){
case 1:
presentasi=5;
cout<<"Nilai presentasi anda adalah "<<presentasi<<endl;
cout<<endl;
break;
case 2:
presentasi=10;
cout<<"Nilai presentasi anda adalah "<<presentasi<<endl;
cout<<endl;
break;
case 3:
presentasi=15;
cout<<"Nilai presentasi anda adalah "<<presentasi<<endl;
cout<<endl;
break;
default:
cout<<"Pilihan yang anda masukan salah "<<endl;
cout<<endl;
goto B;
}
c:
cout<<"masukan nilai Penguasaan Materi anda : ";cin>>pil;
switch (pil){
case 1:
p_m=5;
cout<<"Nilai Penguasaan Materi anda adalah "<<p_m<<endl;
cout<<endl;
break;
case 2:
p_m=15;
cout<<"Nilai Penguasaan Materi anda adalah "<<p_m<<endl;
cout<<endl;
break;
case 3:
p_m=25;
cout<<"Nilai Penguasaan Materi anda adalah "<<p_m<<endl;
cout<<endl;
break;
default:
cout<<"Pilihan yang anda masukan salah "<<endl;
cout<<endl;
goto c;
}
d:
cout<<"masukan nilai Penguasaan Program anda : ";cin>>pil;
switch (pil){
case 1:
p_p=5;
cout<<"Nilai Penguasaan Program anda adalah "<<p_p<<endl;
cout<<endl;
break;
case 2:
p_p=15;
cout<<"Nilai Penguasaan Program anda adalah "<<p_p<<endl;
cout<<endl;
break;
case 3:
p_p=25;
cout<<"Nilai Penguasaan Program anda adalah "<<p_p<<endl;
cout<<endl;
break;
default:
cout<<"Pilihan yang anda masukan salah "<<endl;
cout<<endl;
goto d;
}
f:
cout<<"masukan nilai Demo program anda : ";cin>>pil;
switch (pil){
case 1:
d_m=5;
cout<<"Nilai Demo program anda adalah "<<d_m<<endl;
cout<<endl;
break;
case 2:
d_m=10;
cout<<"Nilai Demo program anda adalah "<<d_m<<endl;
cout<<endl;
break;
case 3:
d_m=15;
cout<<"Nilai Demo program anda adalah "<<d_m<<endl;
cout<<endl;
break;
default:
cout<<"Pilihan yang anda masukan salah "<<endl;
cout<<endl;
goto f;
}
e:
cout<<"masukan nilai Tanya jawab anda : ";cin>>pil;
switch (pil){
case 1:
t_j=10;
cout<<"Nilai Tanya jawab anda adalah "<<t_j<<endl;
cout<<endl;
break;
case 2:
t_j=15;
cout<<"Nilai Tanya jawab anda adalah "<<t_j<<endl;
cout<<endl;
break;
case 3:
t_j=20;
cout<<"Nilai Tanya jawab anda adalah "<<t_j<<endl;
cout<<endl;
break;
default:
cout<<"Pilihan yang anda masukan salah "<<endl;
cout<<endl;
goto e;
}
cout<<"======================================="<<endl;
cout<<"Nilai keseluruhan anda adalah : "<<endl;
cout<<endl;
cout<<"Nilai Presentasi = "<<presentasi<<endl;
cout<<"Nilai Penguasaan materi = "<<p_m<<endl;
cout<<"Nilai Penguasaan program = "<<p_p<<endl;
cout<<"Nilai Demo program = "<<d_m<<endl;
cout<<"Nilai Tanya jawab = "<<t_j<<endl;
cout<<"================================== + "<<endl;
nilai=presentasi+p_m+p_p+d_m+t_j;
if (nilai<=100 && nilai >=80){
cout<<"nilai anda A"<<endl;}
else if (nilai<80 && nilai >=70){
cout<<"nilai anda B"<<endl;}
else if (nilai<70 && nilai >=60){
cout<<"nilai anda C"<<endl;}
else {
cout<<"anda TIDAK LULUS"<<endl;}
cout<<"JUMLAH = "<<nilai<<endl;
cout<<"apakah anda akan mengulang perhitungan [y/t] : ";cin>>cb;
if(cb=='y'||cb=='Y')
goto back;
else
exit(0);

getch();}

Borlan C++ Membuat Absensi mahasiswa tipe lain


#include <iostream.h>
#include <conio.h>
#include <stdio.h>

int a,n;
char nama [20][20], nim[20][20],kehadiran[20][20],pil;
double b, c, d, e, hasil, tambah;
int k1=0;
int k2=0;
int k3=0;
int k4=0;

void menu();

void maha1()
{
clrscr();
cout<<"Input jumlah Mahasiswa :";cin>>n;
for (a=1;a<=n;a++)
{
clrscr();
cout<<"Mahasiswa ke "<<a;
cout<<"\nNama Panggilan Mahasiswa  = ";cin>>nama[a];
cout<<"Input Nim Mahasiswan      = ";cin>>nim[a];
cout<<"Input Keterangan Kehadiran= ";cin>>kehadiran[a];

if(kehadiran[a][0]=='h'||
kehadiran[a][0]=='H')
k1++;
else if(kehadiran[a][0]=='s'||
kehadiran[a][0]=='S')
k2++;
else if(kehadiran[a][0]=='i'||
kehadiran[a][0]=='I')
k3++;
else if(kehadiran[a][0]=='a'||
kehadiran[a][0]=='A')
k4++;
}
menu();
}

void maha2()
{
clrscr();
gotoxy(20,2);cout<<"ABSENSI MAHASISWA NAP";
        gotoxy(1,4);cout<<"Nomor";
        gotoxy(10,4);cout<<"Nama Mahasiswa";
        gotoxy(30,4);cout<<"NIM Mahasiswa";
        gotoxy(50,4);cout<<"Keterangan Kehadiran";
        for (a=1;a<=n;a++)
    {
        gotoxy(3,4+a);cout<<a;
        gotoxy(10,4+a);cout<<nama[a];
        gotoxy(30,4+a);cout<<nim[a];
        gotoxy(50,4+a);cout<<kehadiran[a];

    }
cout<<"\n\nJumlah Mahasiswa \t= "<<n<<endl;
cout<<"Jumlah Hadir \t= "<<k1<<endl;
cout<<"Jumlah Sakit \t= "<<k2<<endl;
cout<<"Jumlah Izin \t= "<<k3<<endl;
cout<<"Jumlah Alpa \t= "<<k4<<endl;
k1=0;k2=0;k3=0;k4=0;
cout<<""<<endl;
gotoxy(30,20);cout<<"## THE END ##";
getch();
menu();
}

void menu()
{
clrscr();
cout<<"Nama         : Achmad Arifin"<<endl;
cout<<"NIM          : 1512142001"<<endl;
cout<<"Kelas        : Universitas CCDP program Telkom Pdc Lampung (2012-2014)"<<endl;
cout<<"Tugas        : Membuat Program Absensi Mahasiswa"<<endl;
cout<<"Pembimbing   : Bapak Rudi Wijaya S.Kom"<<endl;
cout<<"========================================================="<<endl;
cout<<""<<endl;
cout<<"Kode Keterangan"<<endl;
cout<<"=========================================================\n";
cout<<"A Input Absensi Mahasiswa"<<endl;
cout<<"X Menampilkan Jumlah mahasiswa Izin,Sakit,Alpa,dan Hadir"<<endl;
cout<<"=========================================================\n";
cout<<""<<endl;
cout<<"Input Pilihan Menu = ";cin>>pil;
if(pil=='A'||pil=='a')
{
maha1();
}
else if(pil=='X'||pil=='x')
{
maha2();
}

getch();
}

int main()
{
menu();
getch();
return 0;
}


#include <iostream.h>
#include <conio.h>
#include <stdio.h>

int a,n;
char nama [20][20], nim[20][20],kehadiran[20][20],pil;
double b, c, d, e, hasil, tambah;
int k1=0;
int k2=0;
int k3=0;
int k4=0;

void menu();

void maha1()
{
clrscr();
cout<<"Input jumlah Mahasiswa :";cin>>n;
for (a=1;a<=n;a++)
{
clrscr();
cout<<"Mahasiswa ke "<<a;
cout<<"\nNama Panggilan Mahasiswa  = ";cin>>nama[a];
cout<<"Input Nim Mahasiswan      = ";cin>>nim[a];
cout<<"Input Keterangan Kehadiran= ";cin>>kehadiran[a];

if(kehadiran[a][0]=='h'||
kehadiran[a][0]=='H')
k1++;
else if(kehadiran[a][0]=='s'||
kehadiran[a][0]=='S')
k2++;
else if(kehadiran[a][0]=='i'||
kehadiran[a][0]=='I')
k3++;
else if(kehadiran[a][0]=='a'||
kehadiran[a][0]=='A')
k4++;
}
menu();
}

void maha2()
{
clrscr();
gotoxy(20,2);cout<<"ABSENSI MAHASISWA NAP";
        gotoxy(1,4);cout<<"Nomor";
        gotoxy(10,4);cout<<"Nama Mahasiswa";
        gotoxy(30,4);cout<<"NIM Mahasiswa";
        gotoxy(50,4);cout<<"Keterangan Kehadiran";
        for (a=1;a<=n;a++)
    {
        gotoxy(3,4+a);cout<<a;
        gotoxy(10,4+a);cout<<nama[a];
        gotoxy(30,4+a);cout<<nim[a];
        gotoxy(50,4+a);cout<<kehadiran[a];

    }
cout<<"\n\nJumlah Mahasiswa \t= "<<n<<endl;
cout<<"Jumlah Hadir \t= "<<k1<<endl;
cout<<"Jumlah Sakit \t= "<<k2<<endl;
cout<<"Jumlah Izin \t= "<<k3<<endl;
cout<<"Jumlah Alpa \t= "<<k4<<endl;
k1=0;k2=0;k3=0;k4=0;
cout<<""<<endl;
gotoxy(30,20);cout<<"## THE END ##";
getch();
menu();
}

void menu()
{
clrscr();
cout<<"Nama         : Achmad Arifin"<<endl;
cout<<"NIM          : 1512142001"<<endl;
cout<<"Kelas        : Universitas CCDP program Telkom Pdc Lampung (2012-2014)"<<endl;
cout<<"Tugas        : Membuat Program Absensi Mahasiswa"<<endl;
cout<<"Pembimbing   : Bapak Rudi Wijaya S.Kom"<<endl;
cout<<"========================================================="<<endl;
cout<<""<<endl;
cout<<"Kode Keterangan"<<endl;
cout<<"=========================================================\n";
cout<<"A Input Absensi Mahasiswa"<<endl;
cout<<"X Menampilkan Jumlah mahasiswa Izin,Sakit,Alpa,dan Hadir"<<endl;
cout<<"=========================================================\n";
cout<<""<<endl;
cout<<"Input Pilihan Menu = ";cin>>pil;
if(pil=='A'||pil=='a')
{
maha1();
}
else if(pil=='X'||pil=='x')
{
maha2();
}

getch();
}

int main()
{
menu();
getch();
return 0;
}

Minggu, 14 April 2013

Pembelian Pulsa



#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <iomanip.h>
#include <io.h>

void main(){
int ulang;
ulang:
struct pulsa{
char huruf;
int kode;
int harga;
char noju[20];
};
pulsa pls[100];
struct peminjaman{
char KH;
int ka,byad;
float bya;
};
peminjaman  pinjam[100];
struct internet{
int Money;
char kdgol;
char nopel[20];
};
internet itr[100];


int pil;
int i,pl,data,jwb,pem;
int total=0,byr,kmb,denda,dtotal=0;

 textbackground(BLUE + BLINK);
 textcolor(WHITE);
 cout<<" ";cprintf("          FINAL PROJECT  Strukrur Data (Dosen Rudi Wijaya, S.Kom)             ");
 cout<<endl;
 cout<<" ";cprintf("                                                                              ");
 cout<<endl;
 cout<<" ";cprintf("                                                                              ");
 cout<<endl;
 cout<<" ";cprintf("______________________________________________________________________________");
 cout<<endl;
 cout<<" ";cprintf("                                                                              ");
 cout<<endl;
 cout<<" ";cprintf("                     =======CCDP Telkom Pdc=======                      ");
 cout<<endl;
 cout<<" ";cprintf(" Melayani :rental disc,pembelian pulsa tronik dan pembayaran internet speedy  ");
 cout<<endl;
 cout<<" ";cprintf("                                                                              ");
 cout<<endl;
 cout<<" ";cprintf("______________________________________________________________________________");
 cout<<endl;
 cout<<endl;

textcolor(YELLOW);
textbackground(BLUE + BLINK);
cout<<" ";cprintf("-------------------------------");
cout<<endl;
cout<<" ";cprintf("|---------MENU PILIHAN--------|");
cout<<endl;
cout<<" ";cprintf("-------------------------------");
cout<<endl;
cout<<" ";cprintf("1.Rental Disc.                 ");
cout<<endl;
cout<<" ";cprintf("2.Pembelian Pulsa Tronik.      ");
cout<<endl;
cout<<" ";cprintf("3.Pembayaran internet speedy.  ");
cout<<endl;
int H;
H:
textcolor(YELLOW);
textbackground(BLACK + BLINK);
cout<<endl;
cout<<" ";cprintf("Masukan pilihan anda    : ");cin>>pil;
cout<<endl;
if(pil==1){
int mn;
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cout<<" ";cprintf("|===========RENTAL DISK CCDP Telkom Pdc==========|");
cout<<endl;
cout<<" ";cprintf("____________________________________________");
cout<<endl;
mn:
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<endl;
cprintf(" Menu Rental =");
cout<<endl;
cprintf(" 1 PEMINJAMAN.");
cout<<endl;
cprintf(" 2 PENGEMBALIAN.");
cout<<endl;
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" Masukan pilihan  = ");cin>>pl;
cout<<endl;
if(pl==1){
clrscr();
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cout<<" ";cprintf("|===========RENTAL DISC CCDP Telkom Pdc==========|");
cout<<endl;
cout<<" ";cprintf("____________________________________________");
cout<<endl;

textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cout<<" ";cprintf("G/g =Disc Game.");
cout<<endl;
cout<<" ";cprintf("V/v =Disc Video.");
cout<<endl;
cout<<" ";cprintf("L/l =Disc Lagu.");
cout<<endl;
cout<<" ";cprintf("A/a =Disc Aplikasi.");
cout<<endl;
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cprintf("\n                  (PEMINJAMAN)");
cout<<endl;
cout<<" ";cprintf("============================================");
cout<<endl;
cout<<"\n Jumlah yang akan dipinjam = ";cin>>data;
for(i=1;i<=data;i++)
{
cout<<"\n -----------------------------------------";
int f;
f:
cout<<"\n Kode huruf   = ";cin>>pinjam[i].KH;
if(pinjam[i].KH=='G'||pinjam[i].KH=='g')pinjam[i].bya=5000;
else if(pinjam[i].KH=='A'||pinjam[i].KH=='a')pinjam[i].bya=4000;
else if(pinjam[i].KH=='L'||pinjam[i].KH=='l')pinjam[i].bya=3000;
else if(pinjam[i].KH=='V'||pinjam[i].KH=='v')pinjam[i].bya=3500;
else {
textcolor(RED);
cout<<pinjam[i].KH;cprintf(" tidak ada pada daftar,silahkan coba lagi!!");
cout<<endl;
goto f;}
cout<<"\n Kode angka   = ";cin>>pinjam[i].ka;
cout<<"\n Biaya        = "<<pinjam[i].bya;
total=total+pinjam[i].bya;
}
cout<<"\n\n ------------------------------------------";
cout<<"\n Total yang harus dibayar    = "<<total;
cout<<"\n Jumlah uang yang dibayarkan = ";cin>>byr;
kmb=byr-total;
cout<<" Jumlah uang kembalian       = "<<kmb;
cout<<endl;
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" Apakah ingin kembali ke menu(1=ya,0=tidak)= ");cin>>jwb;
cout<<endl;
if(jwb==1){
clrscr();
goto ulang;}
else {
textcolor(GREEN);
cout<<endl;
cprintf("        .-.________      +-----------------------+    ________.-.      ");
cout<<endl;
cprintf("    ----/ \_)_______)          #Terima  Kasih#        (_______(_/ \----");
cout<<endl;
cprintf("       (    ()___)              created by:              (___()    )   ");
cout<<endl;
cprintf("            ()__)              Achmad Arifin              (__()        ");
cout<<endl;
cprintf("    ----\___()_)     +-------------------------------+     (_()___/----");
cout<<endl;
}
}

else if(pl==2)
{
clrscr();
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cout<<" ";cprintf("|===========RENTAL CCDP Telkom Pdc==========|");
cout<<endl;
cout<<" ";cprintf("____________________________________________");
cout<<endl;

textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<" ";cprintf("____________________________________________");

cout<<endl;
cout<<" ";cprintf("G/g =Disc Game.");
cout<<endl;
cout<<" ";cprintf("V/v =Disc Video.");
cout<<endl;
cout<<" ";cprintf("L/l =Disc Lagu.");
cout<<endl;
cout<<" ";cprintf("A/a =Disc Aplikasi.");
cout<<endl;
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cprintf("\n                  (PENGEMBALIAN)");
cout<<endl;
cout<<" ";cprintf("============================================");
cout<<endl;
cout<<"\n Jumlah yang dikembalikan = ";cin>>data;
for(i=1;i<=data;i++)
{
cout<<"\n --------------------------------------------";
int g;
g:
cout<<"\n Kode huruf               =";cin>>pinjam[i].KH;
if(pinjam[i].KH=='G'||pinjam[i].KH=='g')pinjam[i].byad=2000;
else if(pinjam[i].KH=='A'||pinjam[i].KH=='a')pinjam[i].byad=1500;
else if(pinjam[i].KH=='L'||pinjam[i].KH=='l')pinjam[i].byad=500;
else if(pinjam[i].KH=='V'||pinjam[i].KH=='v')pinjam[i].byad=1000;
else {
cout<<pinjam[i].KH;
textcolor(RED);
cout<<pinjam[i].KH;cprintf(" tidak ada pada daftar,silahkan coba lagi!!");
cout<<endl;
goto g;}
cout<<"\n Kode angka               = ";cin>>pinjam[i].ka;
cout<<"\n Keterlambatan peminjaman,brapa hari= ";cin>>pem;
denda=pem*pinjam[i].byad;
cout<<"\n Denda keterlambatan "<<pem<<" hari = "<<denda;
dtotal=dtotal+denda;
}
cout<<"\n\n ------------------------------------------";
cout<<"\n Total denda yang hrus dibayar = "<<dtotal;
cout<<"\n Jumlah uang yang dibayarkan   = ";cin>>byr;kmb=byr-dtotal;
cout<<"\n Jumlah uang kembalian         = "<<kmb;
cout<<endl;
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" Apakah ingin kembali ke menu(1=ya,0=tidak)= ");cin>>jwb;
cout<<endl;
if(jwb==1){
clrscr();
goto ulang;}
else {
textcolor(GREEN);
cout<<endl;
cprintf("        .-.________      +-----------------------+    ________.-.      ");
cout<<endl;
cprintf("    ----/ \_)_______)          #Terima  Kasih#        (_______(_/ \----");
cout<<endl;
cprintf("       (    ()___)              created by:              (___()    )   ");
cout<<endl;
cprintf("            ()__)              Achmad Arifin   (__()        ");
cout<<endl;
cprintf("    ----\___()_)     +-------------------------------+     (_()___/----");
cout<<endl;
}}
else{
textcolor(RED);
cprintf(" Pilihan tidak ada,silahkan coba kembali!");
goto mn;
clrscr();}}
else if(pil==2){
textcolor(YELLOW);
textbackground(BLACK + BLINK);
cout<<" ";cprintf(" _____________________________________________________");
cout<<endl;
cout<<" ";cprintf("|*******************CCDP Telkom Pdc CELL********************|");
cout<<endl;
cout<<" ";cprintf("|_____________________________________________________|");
cout<<endl;
cout<<" ";cprintf("|Mentari| Im3 |Simpati|  As  | XL | Axis | Esia | Tri |");
cout<<endl;
cout<<" ";cprintf("|-------|-----|-------|------|----|------|------|-----|");
cout<<endl;
cout<<" ";cprintf("|  M5   | I5  |  S5   |  A5  | X5 |  Z5  | E5   | T5  |");
cout<<endl;
cout<<" ";cprintf("|  M10  | I10 |  S10  |  A10 | X10|  Z10 | E10  | T10 |");
cout<<endl;
cout<<" ";cprintf("|  M20  | I20 |  S20  |   -  | X20|  Z20 | E20  | T20 |");
cout<<endl;
cout<<" ";cprintf("|  M25  | I25 |   -   |  A25 | X25|  Z25 |  -   |  -  |");
cout<<endl;
cout<<" ";cprintf("|  M50  | I50 |  S50  |  A50 | X50|  Z50 | E50  | T50 |");
cout<<endl;
cout<<" ";cprintf("|_______|_____|_______|______|____|______|______|_____|");
cout<<endl;
int n,i,total=0,uang,kembali,jwb;
cout<<"\n\n Masukan jumlah transaksi: ";cin>>n;
int menu;
menu:
for(i=1;i<=n;i++){
cout<<"\n _______________________________________________________";
cout<<"\n Masukan kode huruf    : ";cin>>pls[i].huruf;
if(pls[i].huruf=='M' || pls[i].huruf=='m'){
int back;
back:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==25){pls[i].harga=26000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto back;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='I' || pls[i].huruf=='i'){
int balik;
balik:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==25){pls[i].harga=26000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto balik;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='S' || pls[i].huruf=='s'){
int z;
z:
cout<<" Masukan nominal pulsa :";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto z;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='A' || pls[i].huruf=='a'){
int bali;
bali:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==25){pls[i].harga=26000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto bali;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='X' || pls[i].huruf=='x'){
int b;
b:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==25){pls[i].harga=26000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto bali;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='Z' || pls[i].huruf=='z'){
int c;
c:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==25){pls[i].harga=26000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto c;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='E' || pls[i].huruf=='e'){
int d;
d:
cout<<" Masukan nominal pulsa :";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto bali;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='T' || pls[i].huruf=='t'){
int e;
e:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto e;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;}
else
{textcolor(RED);
cout<<endl;
cprintf(" Kode huruf tidak ada,silahkan coba lagi!!");
cout<<endl;
goto menu;
}
total=total+pls[i].harga;
}
clrscr();
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" *******************************************************");
cout<<endl;
cprintf(" -------------------Data transaksi----------------------");
cout<<endl;
cprintf(" *******************************************************");
cout<<endl;
for(i=1;i<=n;i++){
cout<<"\n\n Data ke"<<i;
cout<<"\n Pulsa    : "<<pls[i].huruf<<pls[i].kode;
cout<<"\n No Tujuan: "<<pls[i].noju;
cout<<"\n Harga    : "<<pls[i].harga;}
cout<<"\n _______________________________________________________";
cout<<"\n Jumlah yang harus dibayar : "<<total;
cout<<"\n Uang yang dibayarkan      : ";cin>>uang;
kembali=uang-total;
cout<<" Uang kembalian            : "<<kembali;
cout<<endl;
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" Apakah ingin kembali ke menu(1=ya,0=tidak)= ");cin>>jwb;
cout<<endl;
if(jwb==1){clrscr();
goto ulang;}
else {
textcolor(GREEN);
cout<<endl;
cprintf("        .-.________      +-----------------------+    ________.-.      ");
cout<<endl;
cprintf("    ----/ \_)_______)          #Terima  Kasih#        (_______(_/ \----");
cout<<endl;
cprintf("       (    ()___)              created by:              (___()    )   ");
cout<<endl;
cprintf("            ()__)              Achmad Arifin        (__()        ");
cout<<endl;
cprintf("    ----\___()_)     +-------------------------------+     (_()___/----");
cout<<endl;
}}
else if(pil==3){
clrscr();
textcolor(YELLOW);
textbackground(BLACK + BLINK);
cout<<" ";cprintf(" __________________________________________________________");
cout<<endl;
cout<<" ";cprintf("|********************Telkomnet Speedy MJ*******************|");
cout<<endl;
cout<<" ";cprintf("|__________________________________________________________|");
cout<<endl;
cout<<" ";cprintf("|Golongan|  Paket  | Line speed | Monthly  | Quota(/bulan) |");
cout<<endl;
cout<<" ";cprintf("|--------|---------|------------|----------|---------------|");
cout<<endl;
cout<<" ";cprintf("|   A    |Mail     | 1Mbps      | 75.000   | 15 jam        |");
cout<<endl;
cout<<" ";cprintf("|   B    |Chat     | 1Mbps      | 145.000  | 50 jam        |");
cout<<endl;
cout<<" ";cprintf("|   C    |Socialia | 384kbps    | 195.000  | Semi Unlimited|");
cout<<endl;
cout<<" ";cprintf("|   D    |Load     | 512kbps    | 295.000  | Semi Unlimited|");
cout<<endl;
cout<<" ";cprintf("|   E    |Familia  | 1Mbps      | 645.000  | Unlimited     |");
cout<<endl;
cout<<" ";cprintf("|   F    |Executive| 2Mbps      | 995.000  | Unlimited     |");
cout<<endl;
cout<<" ";cprintf("|   G    |Biz      | 3Mbps      | 1.695.000| Unlimited     |");
cout<<endl;
cout<<" ";cprintf("|________|_________|____________|__________|_______________|");
cout<<endl;

int n,i,biaya=0,uang,susuk;
cout<<"\n\n Masukan jumlah transaksi:";cin>>n;
for(i=1;i<=n;i++){
cout<<"\n ______________________________________________________";
cout<<"\n Masukan id pelanggan     : ";cin>>itr[i].nopel;
int re;
re:
cout<<"\n Masukan kode golongan    : ";cin>>itr[i].kdgol;
if(itr[i].kdgol=='A' || itr[i].kdgol=='a'){
itr[i].Money=75000;}
else if(itr[i].kdgol=='B' || itr[i].kdgol=='b'){
itr[i].Money=145000;}
else if(itr[i].kdgol=='C' || itr[i].kdgol=='c'){
itr[i].Money=195000;}
else if(itr[i].kdgol=='D' || itr[i].kdgol=='d'){
itr[i].Money=295000;}
else if(itr[i].kdgol=='E' || itr[i].kdgol=='e'){
itr[i].Money=645000;}
else if(itr[i].kdgol=='F' || itr[i].kdgol=='f'){
itr[i].Money=995000;}
else if(itr[i].kdgol=='G' || itr[i].kdgol=='g'){
itr[i].Money=1695000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Kode golongan tidak ada,silahkan coba lagi!!");
cout<<endl;
goto re;}
biaya=biaya+itr[i].Money;
}
clrscr();
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" *******************************************************");
cout<<endl;
cprintf(" -------------------Data transaksi----------------------");
cout<<endl;
cprintf(" *******************************************************");
cout<<endl;
for(i=1;i<=n;i++){
cout<<"\n\n Data ke"<<i;
cout<<"\n No id pelanggan  : "<<itr[i].nopel;
cout<<"\n Kode golongan    : "<<itr[i].kdgol;
if(itr[i].kdgol=='A' || itr[i].kdgol=='a'){
cout<<"\n Jenis Paket      : Paket Mail";
cout<<"\n Line speed       : 1Mbps";
cout<<"\n Quota(/bulan)    : 15 jam";}
else if(itr[i].kdgol=='B' || itr[i].kdgol=='b'){
cout<<"\n Jenis Paket      : Paket Chat";
cout<<"\n Line speed       : 1Mbps";
cout<<"\n Quota(/bulan)    : 50 jam";}
else if(itr[i].kdgol=='C' || itr[i].kdgol=='c'){
cout<<"\n Jenis Paket      : Paket Socialia";
cout<<"\n Line speed       : 384kbps";
cout<<"\n Quota(/bulan)    : Semi Unlimited";}
else if(itr[i].kdgol=='D' || itr[i].kdgol=='d'){
cout<<"\n Jenis Paket      : Paket Load";
cout<<"\n Line speed       : 512kbps";
cout<<"\n Quota(/bulan)    : Semi Unlimited";}
else if(itr[i].kdgol=='E' || itr[i].kdgol=='e'){
cout<<"\n Jenis Paket      : Paket Familia";
cout<<"\n Line speed       : 1Mbps";
cout<<"\n Quota(/bulan)    : Unlimited";}
else if(itr[i].kdgol=='F' || itr[i].kdgol=='f'){
cout<<"\n Jenis Paket      : Paket Executive";
cout<<"\n Line speed       : 2Mbps";
cout<<"\n Quota(/bulan)    : Unlimited";}
else if(itr[i].kdgol=='G' || itr[i].kdgol=='g'){
cout<<"\n Jenis Paket      : Paket Biz";
cout<<"\n Line speed       : 3Mbps";
cout<<"\n Quota(/bulan)    : Unlimited";}
cout<<"\n Biaya            : "<<itr[i].Money;
cout<<"\n _______________________________________________________";
}
cout<<"\n Biaya yang harus dibayar : "<<biaya;
cout<<"\n Uang yang dibayarkan     : ";cin>>uang;
susuk=uang-biaya;
cout<<" Uang kembalian           : "<<susuk;
cout<<endl;
cout<<endl;
textcolor(YELLOW);
cprintf(" Apakah ingin kembali ke menu(1=ya,0=tidak)= ");cin>>jwb;
cout<<endl;
if(jwb==1){clrscr();
goto ulang;}
else {
textcolor(GREEN);
cout<<endl;
cprintf("        .-.________      +-----------------------+    ________.-.      ");
cout<<endl;
cprintf("    ----/ \_)_______)          #Terima  Kasih#        (_______(_/ \----");
cout<<endl;
cprintf("       (    ()___)              created by:              (___()    )   ");
cout<<endl;
cprintf("            ()__)              Achmad Arifin    (__()        ");
cout<<endl;
cprintf("    ----\___()_)     +-------------------------------+     (_()___/----");
cout<<endl;
}}
else {
textcolor(RED);
cprintf(" Pilihan tidak ada,silahkan coba kembali!");
goto H;}
getch();}

Pembuatan Kasir di C++


#include "stdio.h"
#include "conio.h"

int pilMember,pilMenu,pilMakanan,pilMinuman;
int bayar =0,bayar2=0,uangPembeli,kembalian,total;

void makanan(){
  makan:printf("\n|==|================|========|\n");
          printf("|No|  food          |price   |\n");
        printf("|==|================|========|\n");
        printf("|1.|gado-gado       |Rp.4000 |\n");
        printf("|2.|pecel           |Rp.5500 |\n");
        printf("|3.|nasi kuning     |Rp.7000 |\n");
        printf("|4.|selesai memilih |        |\n");
        printf("|==|================|========|\n");
        printf("inputkan pilihan :");
        scanf("%d",&pilMakanan);
    switch(pilMakanan){
        case 1:{
            printf("Makanan Akan segera di antar \n");
            printf("Tekan enter jika mau milih keembali menu makanan");
            bayar+=+4000;
            getch();
            clrscr();
            goto makan;
            }break;
        case 2:{
            printf("Makanan Akan segera di antar \n");
            printf("Tekan enter jika mau milih keembali menu makanan");
            bayar+=+5500;
            getch();
            clrscr();
            goto makan;
            }break;
        case 3:{
            printf("Makanan Akan segera di antar \n");
            printf("Tekan enter jika mau milih keembali menu makanan");
            bayar+=+7000;
            getch();
            clrscr();
            goto makan;
            }break;
        case 4:{
            clrscr();
            break;
            }break;
        default : printf(" pilihan yang anda masukan tidak ada di list menu");break;
            clrscr();
            goto makan;
    }
}



void minuman(){
  minum:printf("\n|==|================|=========|\n");
          printf("|No|   Drink        |  price  |\n");
        printf("|==|================|=========|\n");
        printf("|1.| JusKalong      |Rp.2500  |\n");
        printf("|2.| tehKalong      |Rp.1500  |\n");
        printf("|3.| kopiKalong     |Rp.2000  |\n");
        printf("|4.| selesai memilih|         |\n");
        printf("|==|================|=========|\n");
        printf("inputkan pilihan :");
        scanf("%d",&pilMinuman);
    switch(pilMinuman){
        case 1:{
            printf("Minuman Akan segera di antar \n");
            printf("Tekan enter jika mau milih keembali menu minuman");
            bayar2+=+2500;
            getch();
            clrscr();
            goto minum;
            }break;
        case 2:{
            printf("Minuman Akan segera di antar \n");
            printf("Tekan enter jika mau milih keembali menu minuman");
            bayar2+=+1500;
            getch();
            clrscr();
            goto minum;
            }break;
        case 3:{
            printf("Minuman Akan segera di antar \n");
            printf("Tekan enter jika mau milih keembali menu minuman");
            bayar2+=+2000;
            getch();
            clrscr();
            goto minum;

            }break;
        case 4:{
            clrscr();
            break;
            }break;
        default :
            printf(" pilihan yang anda masukan tidak ada di list menu");
            clrscr();
            goto minum;
    }
}




void bannerCafe(){
    printf("        Warung Cafe Arfin   \n");
    printf("      Selamat Datang di Cafe \n");
    printf("         Insya'allah Cafe   \n");
    printf("   <=========================>\n");

    }

void pembayaran(){
    pembayar:printf("total pembelian Makanan   :");
    printf("Rp.%d,-",bayar);
    printf("\ntotal pembelian Minuman   :");
    printf("Rp.%d,-",bayar2);
    total=bayar+bayar2;
    printf("\nTOTAL ____________________:Rp.%d,- \n",total);
    printf("Jumlah uang Pembeli       :Rp.");
    scanf("%d",&uangPembeli);
    printf("--------------------  \n");
    kembalian=uangPembeli-total;
    printf("kembalian                 :Rp.%d,- \n",kembalian);
    printf("\n\n\n\t\t\tTerimakasih");
    getch();
    clrscr();
}



void main(){
    menu :
        bannerCafe();
        printf("*Menu\n");
        printf(">----<\n");
        printf("1. List makanan \n");
        printf("2. List Minuman \n");
        printf("3. bayar  \n");
        printf("masukan pilihan :");
        scanf("%d",&pilMenu);
    switch(pilMenu){
        case 1:{
            clrscr();
             bannerCafe();
             makanan();
             goto menu;
            }break;
        case 2:{
            clrscr();
             bannerCafe();
              minuman();
            goto menu;
            }break;
        case 3:{
            clrscr();
            pembayaran();
            goto menu;
            break;}
         default : printf("pilihan yang anda masukan tidak ada di list menu ");
    }
}

Kamis, 11 April 2013

Borland C++ Membuat Konter



#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <iomanip.h>
#include <io.h>

void main(){
int ulang;
ulang:
struct pulsa{
char huruf;
int kode;
int harga;
char noju[20];
};
pulsa pls[100];
struct peminjaman{
char KH;
int ka,byad;
float bya;
};
peminjaman  pinjam[100];
struct internet{
int Money;
char kdgol;
char nopel[20];
};
internet itr[100];


int pil;
int i,pl,data,jwb,pem;
int total=0,byr,kmb,denda,dtotal=0;

 textbackground(BLUE + BLINK);
 textcolor(WHITE);
 cout<<" ";cprintf("          FINAL PROJECT  Strukrur Data (Dosen Rudi Wijaya, S.Kom)             ");
 cout<<endl;
 cout<<" ";cprintf("                                                                              ");
 cout<<endl;
 cout<<" ";cprintf("                                                                              ");
 cout<<endl;
 cout<<" ";cprintf("______________________________________________________________________________");
 cout<<endl;
 cout<<" ";cprintf("                                                                              ");
 cout<<endl;
 cout<<" ";cprintf("                     =======CCDP Telkom Pdc=======                      ");
 cout<<endl;
 cout<<" ";cprintf(" Melayani :rental disc,pembelian pulsa tronik dan pembayaran internet speedy  ");
 cout<<endl;
 cout<<" ";cprintf("                                                                              ");
 cout<<endl;
 cout<<" ";cprintf("______________________________________________________________________________");
 cout<<endl;
 cout<<endl;

textcolor(YELLOW);
textbackground(BLUE + BLINK);
cout<<" ";cprintf("-------------------------------");
cout<<endl;
cout<<" ";cprintf("|---------MENU PILIHAN--------|");
cout<<endl;
cout<<" ";cprintf("-------------------------------");
cout<<endl;
cout<<" ";cprintf("1.Rental Disc.                 ");
cout<<endl;
cout<<" ";cprintf("2.Pembelian Pulsa Tronik.      ");
cout<<endl;
cout<<" ";cprintf("3.Pembayaran internet speedy.  ");
cout<<endl;
int H;
H:
textcolor(YELLOW);
textbackground(BLACK + BLINK);
cout<<endl;
cout<<" ";cprintf("Masukan pilihan anda    : ");cin>>pil;
cout<<endl;
if(pil==1){
int mn;
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cout<<" ";cprintf("|===========RENTAL DISK CCDP Telkom Pdc==========|");
cout<<endl;
cout<<" ";cprintf("____________________________________________");
cout<<endl;
mn:
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<endl;
cprintf(" Menu Rental =");
cout<<endl;
cprintf(" 1 PEMINJAMAN.");
cout<<endl;
cprintf(" 2 PENGEMBALIAN.");
cout<<endl;
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" Masukan pilihan  = ");cin>>pl;
cout<<endl;
if(pl==1){
clrscr();
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cout<<" ";cprintf("|===========RENTAL DISC CCDP Telkom Pdc==========|");
cout<<endl;
cout<<" ";cprintf("____________________________________________");
cout<<endl;

textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cout<<" ";cprintf("G/g =Disc Game.");
cout<<endl;
cout<<" ";cprintf("V/v =Disc Video.");
cout<<endl;
cout<<" ";cprintf("L/l =Disc Lagu.");
cout<<endl;
cout<<" ";cprintf("A/a =Disc Aplikasi.");
cout<<endl;
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cprintf("\n                  (PEMINJAMAN)");
cout<<endl;
cout<<" ";cprintf("============================================");
cout<<endl;
cout<<"\n Jumlah yang akan dipinjam = ";cin>>data;
for(i=1;i<=data;i++)
{
cout<<"\n -----------------------------------------";
int f;
f:
cout<<"\n Kode huruf   = ";cin>>pinjam[i].KH;
if(pinjam[i].KH=='G'||pinjam[i].KH=='g')pinjam[i].bya=5000;
else if(pinjam[i].KH=='A'||pinjam[i].KH=='a')pinjam[i].bya=4000;
else if(pinjam[i].KH=='L'||pinjam[i].KH=='l')pinjam[i].bya=3000;
else if(pinjam[i].KH=='V'||pinjam[i].KH=='v')pinjam[i].bya=3500;
else {
textcolor(RED);
cout<<pinjam[i].KH;cprintf(" tidak ada pada daftar,silahkan coba lagi!!");
cout<<endl;
goto f;}
cout<<"\n Kode angka   = ";cin>>pinjam[i].ka;
cout<<"\n Biaya        = "<<pinjam[i].bya;
total=total+pinjam[i].bya;
}
cout<<"\n\n ------------------------------------------";
cout<<"\n Total yang harus dibayar    = "<<total;
cout<<"\n Jumlah uang yang dibayarkan = ";cin>>byr;
kmb=byr-total;
cout<<" Jumlah uang kembalian       = "<<kmb;
cout<<endl;
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" Apakah ingin kembali ke menu(1=ya,0=tidak)= ");cin>>jwb;
cout<<endl;
if(jwb==1){
clrscr();
goto ulang;}
else {
textcolor(GREEN);
cout<<endl;
cprintf("        .-.________      +-----------------------+    ________.-.      ");
cout<<endl;
cprintf("    ----/ \_)_______)          #Terima  Kasih#        (_______(_/ \----");
cout<<endl;
cprintf("       (    ()___)              created by:              (___()    )   ");
cout<<endl;
cprintf("            ()__)              Achmad Arifin              (__()        ");
cout<<endl;
cprintf("    ----\___()_)     +-------------------------------+     (_()___/----");
cout<<endl;
}
}

else if(pl==2)
{
clrscr();
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cout<<" ";cprintf("|===========RENTAL CCDP Telkom Pdc==========|");
cout<<endl;
cout<<" ";cprintf("____________________________________________");
cout<<endl;

textbackground(BLACK + BLINK);
textcolor(YELLOW);
cout<<" ";cprintf("____________________________________________");

cout<<endl;
cout<<" ";cprintf("G/g =Disc Game.");
cout<<endl;
cout<<" ";cprintf("V/v =Disc Video.");
cout<<endl;
cout<<" ";cprintf("L/l =Disc Lagu.");
cout<<endl;
cout<<" ";cprintf("A/a =Disc Aplikasi.");
cout<<endl;
cout<<" ";cprintf("____________________________________________");
cout<<endl;
cprintf("\n                  (PENGEMBALIAN)");
cout<<endl;
cout<<" ";cprintf("============================================");
cout<<endl;
cout<<"\n Jumlah yang dikembalikan = ";cin>>data;
for(i=1;i<=data;i++)
{
cout<<"\n --------------------------------------------";
int g;
g:
cout<<"\n Kode huruf               =";cin>>pinjam[i].KH;
if(pinjam[i].KH=='G'||pinjam[i].KH=='g')pinjam[i].byad=2000;
else if(pinjam[i].KH=='A'||pinjam[i].KH=='a')pinjam[i].byad=1500;
else if(pinjam[i].KH=='L'||pinjam[i].KH=='l')pinjam[i].byad=500;
else if(pinjam[i].KH=='V'||pinjam[i].KH=='v')pinjam[i].byad=1000;
else {
cout<<pinjam[i].KH;
textcolor(RED);
cout<<pinjam[i].KH;cprintf(" tidak ada pada daftar,silahkan coba lagi!!");
cout<<endl;
goto g;}
cout<<"\n Kode angka               = ";cin>>pinjam[i].ka;
cout<<"\n Keterlambatan peminjaman,brapa hari= ";cin>>pem;
denda=pem*pinjam[i].byad;
cout<<"\n Denda keterlambatan "<<pem<<" hari = "<<denda;
dtotal=dtotal+denda;
}
cout<<"\n\n ------------------------------------------";
cout<<"\n Total denda yang hrus dibayar = "<<dtotal;
cout<<"\n Jumlah uang yang dibayarkan   = ";cin>>byr;kmb=byr-dtotal;
cout<<"\n Jumlah uang kembalian         = "<<kmb;
cout<<endl;
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" Apakah ingin kembali ke menu(1=ya,0=tidak)= ");cin>>jwb;
cout<<endl;
if(jwb==1){
clrscr();
goto ulang;}
else {
textcolor(GREEN);
cout<<endl;
cprintf("        .-.________      +-----------------------+    ________.-.      ");
cout<<endl;
cprintf("    ----/ \_)_______)          #Terima  Kasih#        (_______(_/ \----");
cout<<endl;
cprintf("       (    ()___)              created by:              (___()    )   ");
cout<<endl;
cprintf("            ()__)              Achmad Arifin   (__()        ");
cout<<endl;
cprintf("    ----\___()_)     +-------------------------------+     (_()___/----");
cout<<endl;
}}
else{
textcolor(RED);
cprintf(" Pilihan tidak ada,silahkan coba kembali!");
goto mn;
clrscr();}}
else if(pil==2){
textcolor(YELLOW);
textbackground(BLACK + BLINK);
cout<<" ";cprintf(" _____________________________________________________");
cout<<endl;
cout<<" ";cprintf("|*******************CCDP Telkom Pdc CELL********************|");
cout<<endl;
cout<<" ";cprintf("|_____________________________________________________|");
cout<<endl;
cout<<" ";cprintf("|Mentari| Im3 |Simpati|  As  | XL | Axis | Esia | Tri |");
cout<<endl;
cout<<" ";cprintf("|-------|-----|-------|------|----|------|------|-----|");
cout<<endl;
cout<<" ";cprintf("|  M5   | I5  |  S5   |  A5  | X5 |  Z5  | E5   | T5  |");
cout<<endl;
cout<<" ";cprintf("|  M10  | I10 |  S10  |  A10 | X10|  Z10 | E10  | T10 |");
cout<<endl;
cout<<" ";cprintf("|  M20  | I20 |  S20  |   -  | X20|  Z20 | E20  | T20 |");
cout<<endl;
cout<<" ";cprintf("|  M25  | I25 |   -   |  A25 | X25|  Z25 |  -   |  -  |");
cout<<endl;
cout<<" ";cprintf("|  M50  | I50 |  S50  |  A50 | X50|  Z50 | E50  | T50 |");
cout<<endl;
cout<<" ";cprintf("|_______|_____|_______|______|____|______|______|_____|");
cout<<endl;
int n,i,total=0,uang,kembali,jwb;
cout<<"\n\n Masukan jumlah transaksi: ";cin>>n;
int menu;
menu:
for(i=1;i<=n;i++){
cout<<"\n _______________________________________________________";
cout<<"\n Masukan kode huruf    : ";cin>>pls[i].huruf;
if(pls[i].huruf=='M' || pls[i].huruf=='m'){
int back;
back:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==25){pls[i].harga=26000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto back;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='I' || pls[i].huruf=='i'){
int balik;
balik:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==25){pls[i].harga=26000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto balik;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='S' || pls[i].huruf=='s'){
int z;
z:
cout<<" Masukan nominal pulsa :";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto z;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='A' || pls[i].huruf=='a'){
int bali;
bali:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==25){pls[i].harga=26000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto bali;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='X' || pls[i].huruf=='x'){
int b;
b:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==25){pls[i].harga=26000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto bali;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='Z' || pls[i].huruf=='z'){
int c;
c:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==25){pls[i].harga=26000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto c;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='E' || pls[i].huruf=='e'){
int d;
d:
cout<<" Masukan nominal pulsa :";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto bali;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;
}
else if(pls[i].huruf=='T' || pls[i].huruf=='t'){
int e;
e:
cout<<" Masukan nominal pulsa : ";cin>>pls[i].kode;
if(pls[i].kode==5){pls[i].harga=6000;}
else if(pls[i].kode==10){pls[i].harga=11000;}
else if(pls[i].kode==20){pls[i].harga=21000;}
else if(pls[i].kode==50){pls[i].harga=51000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Nominal tidak ada,silahkan coba lagi!!");
cout<<endl;
goto e;}
cout<<" Harga pulsa           : "<<pls[i].harga;
cout<<"\n Masukan no tujuan     : ";cin>>pls[i].noju;}
else
{textcolor(RED);
cout<<endl;
cprintf(" Kode huruf tidak ada,silahkan coba lagi!!");
cout<<endl;
goto menu;
}
total=total+pls[i].harga;
}
clrscr();
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" *******************************************************");
cout<<endl;
cprintf(" -------------------Data transaksi----------------------");
cout<<endl;
cprintf(" *******************************************************");
cout<<endl;
for(i=1;i<=n;i++){
cout<<"\n\n Data ke"<<i;
cout<<"\n Pulsa    : "<<pls[i].huruf<<pls[i].kode;
cout<<"\n No Tujuan: "<<pls[i].noju;
cout<<"\n Harga    : "<<pls[i].harga;}
cout<<"\n _______________________________________________________";
cout<<"\n Jumlah yang harus dibayar : "<<total;
cout<<"\n Uang yang dibayarkan      : ";cin>>uang;
kembali=uang-total;
cout<<" Uang kembalian            : "<<kembali;
cout<<endl;
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" Apakah ingin kembali ke menu(1=ya,0=tidak)= ");cin>>jwb;
cout<<endl;
if(jwb==1){clrscr();
goto ulang;}
else {
textcolor(GREEN);
cout<<endl;
cprintf("        .-.________      +-----------------------+    ________.-.      ");
cout<<endl;
cprintf("    ----/ \_)_______)          #Terima  Kasih#        (_______(_/ \----");
cout<<endl;
cprintf("       (    ()___)              created by:              (___()    )   ");
cout<<endl;
cprintf("            ()__)              Achmad Arifin        (__()        ");
cout<<endl;
cprintf("    ----\___()_)     +-------------------------------+     (_()___/----");
cout<<endl;
}}
else if(pil==3){
clrscr();
textcolor(YELLOW);
textbackground(BLACK + BLINK);
cout<<" ";cprintf(" __________________________________________________________");
cout<<endl;
cout<<" ";cprintf("|********************Telkomnet Speedy MJ*******************|");
cout<<endl;
cout<<" ";cprintf("|__________________________________________________________|");
cout<<endl;
cout<<" ";cprintf("|Golongan|  Paket  | Line speed | Monthly  | Quota(/bulan) |");
cout<<endl;
cout<<" ";cprintf("|--------|---------|------------|----------|---------------|");
cout<<endl;
cout<<" ";cprintf("|   A    |Mail     | 1Mbps      | 75.000   | 15 jam        |");
cout<<endl;
cout<<" ";cprintf("|   B    |Chat     | 1Mbps      | 145.000  | 50 jam        |");
cout<<endl;
cout<<" ";cprintf("|   C    |Socialia | 384kbps    | 195.000  | Semi Unlimited|");
cout<<endl;
cout<<" ";cprintf("|   D    |Load     | 512kbps    | 295.000  | Semi Unlimited|");
cout<<endl;
cout<<" ";cprintf("|   E    |Familia  | 1Mbps      | 645.000  | Unlimited     |");
cout<<endl;
cout<<" ";cprintf("|   F    |Executive| 2Mbps      | 995.000  | Unlimited     |");
cout<<endl;
cout<<" ";cprintf("|   G    |Biz      | 3Mbps      | 1.695.000| Unlimited     |");
cout<<endl;
cout<<" ";cprintf("|________|_________|____________|__________|_______________|");
cout<<endl;

int n,i,biaya=0,uang,susuk;
cout<<"\n\n Masukan jumlah transaksi:";cin>>n;
for(i=1;i<=n;i++){
cout<<"\n ______________________________________________________";
cout<<"\n Masukan id pelanggan     : ";cin>>itr[i].nopel;
int re;
re:
cout<<"\n Masukan kode golongan    : ";cin>>itr[i].kdgol;
if(itr[i].kdgol=='A' || itr[i].kdgol=='a'){
itr[i].Money=75000;}
else if(itr[i].kdgol=='B' || itr[i].kdgol=='b'){
itr[i].Money=145000;}
else if(itr[i].kdgol=='C' || itr[i].kdgol=='c'){
itr[i].Money=195000;}
else if(itr[i].kdgol=='D' || itr[i].kdgol=='d'){
itr[i].Money=295000;}
else if(itr[i].kdgol=='E' || itr[i].kdgol=='e'){
itr[i].Money=645000;}
else if(itr[i].kdgol=='F' || itr[i].kdgol=='f'){
itr[i].Money=995000;}
else if(itr[i].kdgol=='G' || itr[i].kdgol=='g'){
itr[i].Money=1695000;}
else{
cout<<endl;
textcolor(RED);
cprintf(" Kode golongan tidak ada,silahkan coba lagi!!");
cout<<endl;
goto re;}
biaya=biaya+itr[i].Money;
}
clrscr();
textbackground(BLACK + BLINK);
textcolor(YELLOW);
cprintf(" *******************************************************");
cout<<endl;
cprintf(" -------------------Data transaksi----------------------");
cout<<endl;
cprintf(" *******************************************************");
cout<<endl;
for(i=1;i<=n;i++){
cout<<"\n\n Data ke"<<i;
cout<<"\n No id pelanggan  : "<<itr[i].nopel;
cout<<"\n Kode golongan    : "<<itr[i].kdgol;
if(itr[i].kdgol=='A' || itr[i].kdgol=='a'){
cout<<"\n Jenis Paket      : Paket Mail";
cout<<"\n Line speed       : 1Mbps";
cout<<"\n Quota(/bulan)    : 15 jam";}
else if(itr[i].kdgol=='B' || itr[i].kdgol=='b'){
cout<<"\n Jenis Paket      : Paket Chat";
cout<<"\n Line speed       : 1Mbps";
cout<<"\n Quota(/bulan)    : 50 jam";}
else if(itr[i].kdgol=='C' || itr[i].kdgol=='c'){
cout<<"\n Jenis Paket      : Paket Socialia";
cout<<"\n Line speed       : 384kbps";
cout<<"\n Quota(/bulan)    : Semi Unlimited";}
else if(itr[i].kdgol=='D' || itr[i].kdgol=='d'){
cout<<"\n Jenis Paket      : Paket Load";
cout<<"\n Line speed       : 512kbps";
cout<<"\n Quota(/bulan)    : Semi Unlimited";}
else if(itr[i].kdgol=='E' || itr[i].kdgol=='e'){
cout<<"\n Jenis Paket      : Paket Familia";
cout<<"\n Line speed       : 1Mbps";
cout<<"\n Quota(/bulan)    : Unlimited";}
else if(itr[i].kdgol=='F' || itr[i].kdgol=='f'){
cout<<"\n Jenis Paket      : Paket Executive";
cout<<"\n Line speed       : 2Mbps";
cout<<"\n Quota(/bulan)    : Unlimited";}
else if(itr[i].kdgol=='G' || itr[i].kdgol=='g'){
cout<<"\n Jenis Paket      : Paket Biz";
cout<<"\n Line speed       : 3Mbps";
cout<<"\n Quota(/bulan)    : Unlimited";}
cout<<"\n Biaya            : "<<itr[i].Money;
cout<<"\n _______________________________________________________";
}
cout<<"\n Biaya yang harus dibayar : "<<biaya;
cout<<"\n Uang yang dibayarkan     : ";cin>>uang;
susuk=uang-biaya;
cout<<" Uang kembalian           : "<<susuk;
cout<<endl;
cout<<endl;
textcolor(YELLOW);
cprintf(" Apakah ingin kembali ke menu(1=ya,0=tidak)= ");cin>>jwb;
cout<<endl;
if(jwb==1){clrscr();
goto ulang;}
else {
textcolor(GREEN);
cout<<endl;
cprintf("        .-.________      +-----------------------+    ________.-.      ");
cout<<endl;
cprintf("    ----/ \_)_______)          #Terima  Kasih#        (_______(_/ \----");
cout<<endl;
cprintf("       (    ()___)              created by:              (___()    )   ");
cout<<endl;
cprintf("            ()__)              Achmad Arifin    (__()        ");
cout<<endl;
cprintf("    ----\___()_)     +-------------------------------+     (_()___/----");
cout<<endl;
}}
else {
textcolor(RED);
cprintf(" Pilihan tidak ada,silahkan coba kembali!");
goto H;}
getch();}

Borland Menampilkan Absensi Mahasiswa


#include <iostream.h>
#include <conio.h>

int a,n;
char nama [20][20], nim[20][20],kehadiran[20][20],pil;
double b, c, d, e, hasil, tambah;
int k1=0;
int k2=0;
int k3=0;
int k4=0;

void menu();

void maha1()
{
clrscr();
cout<<"Input jumlah Mahasiswa :";cin>>n;
for (a=1;a<=n;a++)
{
clrscr();
cout<<"Mahasiswa ke "<<a;
cout<<"\nNama Mahasiswa = ";cin>>nama[a];
cout<<"Input Nim Mahasiswan = ";cin>>nim[a];
cout<<"Input Keterangan Kehadiran = ";cin>>kehadiran[a];

if(kehadiran[a][0]=='h'||
kehadiran[a][0]=='H')
k1++;
else if(kehadiran[a][0]=='s'||
kehadiran[a][0]=='S')
k2++;
else if(kehadiran[a][0]=='i'||
kehadiran[a][0]=='I')
k3++;
else if(kehadiran[a][0]=='a'||
kehadiran[a][0]=='A')
k4++;
}
menu();
}

void maha2()
{
clrscr();
gotoxy(20,2);cout<<"ABSENSI MAHASISWA NAP";
        gotoxy(1,4);cout<<"Nomor";
        gotoxy(10,4);cout<<"Nama Mahasiswa";
        gotoxy(30,4);cout<<"NIM Mahasiswa";
        gotoxy(50,4);cout<<"Keterangan Kehadiran";
        for (a=1;a<=n;a++)
    {
        gotoxy(3,4+a);cout<<a;
        gotoxy(10,4+a);cout<<nama[a];
        gotoxy(30,4+a);cout<<nim[a];
        gotoxy(50,4+a);cout<<kehadiran[a];

    }
cout<<"\n\nJumlah Mahasiswa \t= "<<n<<endl;
cout<<"Jumlah Hadir \t= "<<k1<<endl;
cout<<"Jumlah Sakit \t= "<<k2<<endl;
cout<<"Jumlah Izin \t= "<<k3<<endl;
cout<<"Jumlah Alpa \t= "<<k4<<endl;
k1=0;k2=0;k3=0;k4=0;
cout<<""<<endl;
gotoxy(30,20);cout<<"## THE END ##";
getch();
menu();
}

void menu()
{
clrscr();
cout<<"Nama         : Achmad Arifin"<<endl;
cout<<"NIM          : 1512142001"<<endl;
cout<<"Kelas        : Universitas CCDP program Telkom Pdc Lampung (2012-2014)"<<endl;
cout<<"Tugas        : Membuat Program Absensi Mahasiswa"<<endl;
cout<<"Pembimbing   : Bapak Rudi Wijaya S.Kom"<<endl;
cout<<"========================================================="<<endl;
cout<<""<<endl;
cout<<"Kode Keterangan"<<endl;
cout<<"=========================================================\n";
cout<<"A Input Absensi Mahasiswa"<<endl;
cout<<"X Menampilkan Jumlah mahasiswa Izin,Sakit,Alpa,dan Hadir"<<endl;
cout<<"=========================================================\n";
cout<<""<<endl;
cout<<"Input Pilihan Menu = ";cin>>pil;
if(pil=='A'||pil=='a')
{
maha1();
}
else if(pil=='X'||pil=='x')
{
maha2();
}

getch();
}

int main()
{
menu();
getch();
return 0;
}