Rabu, 08 Februari 2012

c++ Program Kasir

Program buat kasir nie peke compiler visual basic...
q pake header time biar assyikk..mirip aslinya gitu..
hehehe..
Buat pengulanganne q pake fungsi lagi....^_^
selamat mencoba...
#include<iostream.h>
#include <time.h>
#include <windows.h>
#include <conio.h>

void Time()
{
time_t tim=time(NULL);
char *s=ctime(&tim);
cout<<s;

}
void main(){
char k[80];
char m[80];
char x;
double a,b;
atas:
system("cls");
cout<<"================================"<<endl;
cout<<" GEMA INSANI JAYA"<<endl;
cout<<"================================"<<endl<<endl;
cout<<"Nama Kasir : ";
cin>>k;
cout<<"Nama Pembeli : ";
cin>>m;

cout<<"Masukkan Nominal Pembelian : Rp.";
cin>>a;
//break;
system("cls");
cout<<"================================"<<endl;
cout<<" GEMA INSANI JAYA"<<endl;
cout<<" jl Sumbersari Gg.5 473 Malang"<<endl;
cout<<"================================"<<endl<<endl;

Time();

if (a < 50000)
b=a-(0.05*a);
else
b=a-(0.2*a);

cout<<"--------------------------------"<<endl<<endl;
cout<<"Nama Kasir : "<<k<<endl;
cout<<"Nama Pembeli : "<<m<<endl;
cout<<"Membeli : Rp."<<a<<endl;
cout<<"Bayar : Rp."<<b<<endl<<endl;
cout<<"--------------------------------"<<endl;
cout<<" Terima Kasih"<<endl;
cout<<" Atas Kunjungan Anda"<<endl;
cout<<"================================"<<endl<<endl;
cout<<"Apakah Anda Ingin Mengulang..(Y/T)??";
cin>>x;
{if(x=='Y'||x=='y')
goto atas;
else(x=='T'||x=='t');
}

}
Tampilan programnya adalah kayak gni...


Tidak ada komentar:

Posting Komentar