Senin, 28 September 2009

Program BANK

Tugas bp 2 : program BANK

Source code

#include

#include

class Bank_account

{

private:

long int transferek, tabung , ambil, transf ;

char nama [20];

long int rekening;

public:


void setor()

{ cout<<"Jumlah uang yang di Setor =";

cin>>tabung;

cout<<"\n";

cout<<"\tNo Rekening anda "<<

cout<<"\tJumlah ang yang di Setorkan Rp."<<

};

void tarikan()

{

cout<<"Penarikan uang anda =";

cin>>ambil;

cout<<"\n";

cout<<"\tNo Rekening anda "<<

cout<<"\tTarikan uang yang anda lakukan sebesar = Rp. "<<

};

void transfer()

{

cout<<"Jumlah uang yang akan ditransfer =";

cin>>transf;

cout<<"Masukkan no rekening tujuan transfer =";

cin>>transferek;

cout<<"\n";

cout<<"\tNo Rekening anda "<<

cout<<"\tNo Rekening tujuan "<<

cout<<"\tJumlah uang yang di Transfer Rp."<<

};

void Rekening()

{

cout<<"\nProgram BANK Acount AJA\n";

cout<<"Masukkan no rekening anda =";

cin>>rekening;

};

};

void main()

{

cout<<"\t\t-----------------\n";

cout<<"\t\t- ADI KURNIAWAN -\n";

cout<<"\t\t-----------------\n";

Bank_account AJA;

char lagi;

int pilihan;

{

AJA.Rekening();

do

{

system("cls");

cout<<"\nProgram BANK AJA(ADI JAYA)\n";

cout<<"Menu\n";

cout<<"1. Setor \n";

cout<<"2. Tarikan Tunai \n";

cout<<"3. Transfer \n";

cout<<"Pilihan =";cin>>pilihan;

switch (pilihan)

{

case 1:

cout<<"\nSetoran \n";

AJA.setor();

break;

case 2:

cout<<"\nPenarikan \n";

AJA.tarikan();

break;

case 3:

cout<<"\nTransfer \n";

AJA.transfer();

break;

default:

cout<<"\ntidak ada pilhan";


}

cout<<"\nApakah anda ingin mengulang lagi (Y/T)?";

cin>>lagi;

}

while((lagi=='Y')||(lagi=='y'));

}

};

output


Tidak ada komentar:

Posting Komentar