Jumat, 16 Desember 2011

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

//membuat fungsi hitung
float hitung(float a, float b)
{
return(a*b);
}
//membuat fungsi bayar
float bayar(float a, float b)
{
return(a+b);
}

//program utama
main()
{
struct
{
char nk[20],kd;
float hrg,jml,total;
}kue[5];

float tb=0;
char np[20];
int i,j;
clrscr();

cout<<"             TOKO KUE \"WUEENAK\""<<endl;
cout<<"JL. Kalibata Timur No.37 telp (021) 7901074"<<endl;
garis();
cout<<"Masukan Nama Pembeli :";cin>>np;
cout<<"Masukan jumlah data  :";cin>>j;
cout<<endl;
for(i=1;i<=j;i++)
{
cout<<"Data ke- "<<i<<endl;

cout<<"   Kode Kue :";cin>>kue[i].kd;
if(kue[i].kd=='A' || kue[i].kd=='a')
   {
   strcpy(kue[i].nk,"Brownies");
   kue[i].hrg=15000;
   }
   else if(kue[i].kd=='B' || kue[i].kd=='b')
   {
   strcpy(kue[i].nk,"Cake");
   kue[i].hrg=25000;
   }
   else if(kue[i].kd=='C' || kue[i].kd=='c')
   {
   strcpy(kue[i].nk,"Keju");
   kue[i].hrg=20000;
   }
   else
   {
   cout<<"\tKode yang anda masukan salah!!!,input[A/B/C]!"<<endl;
  }
cout<<" Masukkan  Jumlah Beli          :";cin>>kue[i].jml;
kue[i].total=hitung(kue[i].jml,kue[i].hrg); //deklarasi fungsi hitung
tb=bayar(kue[i].total,tb); //deklarasi fungsi bayar
}
clrscr();
cout<<endl<<endl;
cout<<"         LAPORAN PENJUALAN TOKO KUE \"WUENAAK\""<<endl;
cout<<"  JL. Kalibata Timur No.37 telp (021) 7901074"<<endl;
cout<<endl<<endl;
cout<<"Nama pembeli   :"<<np<<endl;
cout<<"===================================================="<<endl;
cout<<"No.  Kode    Nama    Harga     Jumlah   Jumlah "<<endl;
cout<<"         Kue      Kue      Kue          Beli     Bayar       "<<endl;
cout<<"===================================================="<<endl;
for(i=1;i<=j;i++)
{
  cout<<setiosflags(ios::left)<<setw(5)<<i;
  cout<<setiosflags(ios::left)<<setw(6)<<kue[i].kd;
  cout<<setiosflags(ios::left)<<setw(10)<<kue[i].nk;
  cout<<setiosflags(ios::left)<<setw(12)<<kue[i].hrg;
  cout<<setiosflags(ios::left)<<setw(6)<<kue[i].jml;
  cout<<setiosflags(ios::left)<<setw(10)<<kue[i].total<<endl;
}
cout<<"===================================================="<<endl;
cout<<"                        Total bayar  :  "<<tb<<endl;
cout<<endl;cout<<"TERIMA KASIH ATAS KEDATANGANNYA";
getch();
}

Jumat, 28 Oktober 2011

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main()
{
char kdplg,jnsplg[30],jentik[30];
int kdtiket,jumbel,hrg;
float tothar,diskon,totbay;
cout<<"                                Cinema 21           "<<endl;
cout<<"======================================="<<endl;
cout<<"Kode Pelanggan[A/B/C]   :";cin>>kdplg;
cout<<"Kode Tiket    [1/2/3]   :";cin>>kdtiket;
cout<<"Jumlah Beli            :";cin>>jumbel;
cout<<"======================================="<<endl;
switch (kdplg)
{
case 'A':
case 'a':
strcpy(jnsplg,"Umum");
break;
case 'B':
case 'b':
strcpy(jnsplg,"Member");
break;
case 'C':
case 'c':
strcpy(jnsplg,"Pelajar");
break;
default:
strcpy(jnsplg,"Kode Tidak ada");
}


switch (kdtiket)
{
case 1:
{
strcpy(jentik,"VIP");
hrg=50000;}
break;
case 2:
{
strcpy(jentik,"Ekonomi");
hrg=45000;}
break;
case 3:
{
strcpy(jentik,"Nomat");
hrg=30000;}
break;
default:
{
strcpy(jentik,"Salah Kode Tiket");
hrg=0 ;}
}

cout<<"Jenis Pelanggan        :"<<jnsplg<<endl;
cout<<"Jenis Tiket            :"<<jentik<<endl;
cout<<"Harga  Tiket             :"<<hrg<<endl;
cout<<"======================================="<<endl;
tothar=hrg*jumbel;
cout<<"total Harga            :"<<tothar<<endl;
if(kdplg=='a' || kdplg=='A' && kdtiket==1)
diskon=0.1*tothar;
else
if(kdplg=='C' || kdplg=='c' && kdtiket==2)
diskon=0.15*tothar;
else
if(kdplg=='B' || kdplg=='b' && kdtiket==1)
diskon=0.2*tothar;
else
diskon=0;
cout<<"Diskon                 :"<<diskon<<endl;
totbay=tothar-diskon;
cout<<"Total Bayar            :"<<totbay<<endl;
cout<<"======================================="<<endl;
cout<<"             TERIMA KASIH            "<<endl;
getch(); }

Jumat, 21 Oktober 2011

#include<stdio.h>
#include<conio.h>
#include<iostream.h>
main( )
{
char kode,type,merk[15],jenis[15];
long harga,total;
int jumbel;
clrscr( );
cout<<"Kode Mobil : ";cin>>kode;
cout<<"Type Mobil : ";cin>>type;
cout<<"MAsukkan Jumlah Beli : ";cin>>jumbel;
if (kode=='T' || kode=='t')
{
strcpy(merk,"Toyota");
if (type=='S' || type =='s')
{
strcpy(jenis,"Sedan");
harga=125000000;
}
else if (type=='M' || type =='m')
{
strcpy(jenis,"Minibus");
harga=150000000;
}
}
else if (kode=='H' || kode=='h')
{
strcpy(merk,"Honda");
if (type=='S' || type =='s')
{
strcpy(jenis,"Sedan");
harga=130000000;
}
else if (type=='M' || type =='m')
{
strcpy(jenis,"Minibus");
harga=170000000;
}
}
else
{
cout<<"Salah Kode"<<endl;
}
total=harga*jumbel;
cout<<"------------------------"<<endl;
cout<<"Kode Mobil : "<<kode<<endl;
cout<<"Merk Mobil : "<<merk<<endl;
cout<<"type Mobil : "<<type<<endl;
cout<<"Jenis Mobil : "<<jenis<<endl;
cout<<"Harga Mobil : "<<harga<<endl;
cout<<"Jumlah Beli : "<<jumbel<<endl;
cout<<"Total Harga : "<<total<<endl;
getch();
}

Rabu, 19 Oktober 2011

#include<iostream.h>
#include<stdio.h>
#include"conio.h"
main()
{
char kode,nmpembeli[25],judul[25];
long diskon,total,jumbay;
int jumbel,harga;
cout<<"Cinema 21"<<endl;
cout<<"===================="<<endl;
cout<<"Masukkan Nama Pembeli     :";cin>>nmpembeli;
cout<<"Masukkan Kode Studio[A/B] :";cin>>kode;
cout<<"Masukkan JUmlah Beli     :";cin>>jumbel;
switch (kode)
{
case 'A':
case 'a':
{
strcpy(judul,"Harry Potter");
harga=20000;
break;
}
case 'B':
case 'b':
{
strcpy(judul,"Final Destinations");
harga=30000;
break;
}
default:
{
cout<<"Kode tidak ada";
}
}
total=harga*jumbel;
if (jumbel>=4)
{
diskon=0.1*total;
}
else
if (jumbel>=2)
{
diskon=0.05*total;
}
else
{
diskon=0;
}
jumbay=total-diskon;
cout<<endl;
cout<<"Cinema 21"<<endl;
cout<<"==================="<<endl;
cout<<"Nama Pembeli ="<<nmpembeli<<endl;
cout<<"kode teathre  ="<<kode<<endl;
cout<<"Judul Film  ="<<judul<<endl;
cout<<"Harga        ="<<harga<<endl;
cout<<"Jumlah Beli  ="<<jumbel<<endl;
cout<<"Totalharga  ="<<total<<endl;
cout<<"Diskon  ="<<diskon<<endl;
cout<<"Jumlah bayar  ="<<jumbay<<endl;
getch();
}

Rabu, 05 Oktober 2011

#include<conio.h>
#include<stdio.h>
#include<iostream.h>
main()
{
char nama[30],nim[8];
float nabsen,ntugas,nuts,nuas,nakhir;
printf(" Nilai Mahasiswa \n");
printf("=========================\n");
printf("Masukkan Nama Anda   : ");scanf("%s",&nama);
printf("Masukkan Nim Anda   : ");scanf("%s",&nim);
printf("Masukkan Nilai Absen     : ");scanf("%f",&nabsen);
printf("Masukkan Nilai Tugas     : ");scanf("%f",&ntugas);
printf("Masukkan Nilai Uts     : ");scanf("%f",&nuts);
printf("Masukkan Nilai Uas     : ");scanf("%f",&nuas);
nakhir=(0.1*nabsen)+(0.2*ntugas)+(0.3*nuts)+(0.4*nuas);
printf("Hasil Nilai mahasiswa   \n");
printf("=========================\n ");
printf("Mahasiswa Yang bernama : %s",nama);
printf("Dengan Nim             :  %s",nim);
printf("mendapatkan Nilai Akhir = %.2f \n",nakhir);
getch();
}

Sabtu, 24 September 2011

Silahkan download disini

Sabtu, 21 Mei 2011

download disini

Popular Posts
  • Membuat Menu Utama dan File .Exe pada Visual Foxpro 9.0
  • Aplikasi Peminjaman Menggunakan Visual Foxpro 9.0
  • MENGHITUNG SELISIH TANGGAL DI DELPHI 7
  • LATIHAN DELPHI PRA UAS
  • Contoh Array + Fungsi
  • Quiz Foxpro Kredit Motor
  • Tugas Pertemuan 7-8
  • Menghitung Nlai akhir Mahasiswa menggunakan scanf dan printf
  • Assalamualaikum Wr. Wb.
  • Materi Delphi selasa 4 Januari 2010