/*program data transaksi bank*/
#include <iostream.h>
#include <conio.h>
void main()
{
int sa = 1000;
long nt, kode;
char jawab;
cout << "----------------------------------------------"<<endl;
cout << "\tProgram Pengolahan Data Transaksi Tabungan \n ";
cout<<"\t=============================================\n";
cout <<endl;
do{
cout << "Nilai Transaksi\t\t\t : "; cin >> nt;
cout << "Kode Transaksi[1= Simpan /2=Ambil] : "; cin >> kode;
/*percabangan*/
if(kode== 1)
{
cout << "Saldo Awal\t\t\t : " <<sa<<endl;
sa+=nt;
cout << "Saldo Akhir\t\t\t : " <<sa<<endl;
cout <<endl;
}
else
{
if(nt<=sa)
{
cout << "Saldo Awal\t\t\t :" <<sa<<endl;
sa-=nt;
cout << "Saldo Akhir\t\t\t :" <<sa<<endl;
cout <<endl;
}
else
{
sa-=nt;
cout << "Saldo Tidak Mencukupi"<<endl;
goto end;
}
}
/*perulangan*/
cout << "Masih Ada Transaksi Lain [Y/T]?\t : "; cin >> jawab;
cout <<endl;
}
while(jawab == 'Y' || jawab == 'y');
jawab++;
end:
cout << "\t TRIMA KASIH,ATAS TRANSAKSI ANDA.\n";
}
Sekian coding ini jika ada kesalahan harap mencermati coding nya.
semoga bermanfaat.
Ditulis olh :MUH RIDHO WACHID S
Tidak ada komentar:
Posting Komentar