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();
}

Popular Posts
  • MENGHITUNG SELISIH TANGGAL DI DELPHI 7
  • Aplikasi Peminjaman Menggunakan Visual Foxpro 9.0
  • Contoh Array + Fungsi
  • LATIHAN DELPHI PRA UAS
  • Materi Foxpro Untuk hari Kamis 6 Januari 2011
  • Assalamualaikum Wr. Wb.
  • Games Ramalan Cinta Sederhana
  • Materi & Tugas Delphi Pert.7
  • Membuat Menu Utama dan File .Exe pada Visual Foxpro 9.0
  • Lesson 4th create database design with SQL Language in Ms.Access 2003