Periksa buku tabungan salah satu anggota kelompok. Lakukan detail transaksi pengambilan uang tabungan termasuk detail isian dalam formulir transaksi. Pisahkan algoritma penulisan angka menjadi ejaan :
Misal anda mengambil uang sebesar 300.000 akan tertulis sebagai ‘Tiga ratus ribu rupiah”
Tulislah menggunakan huruf miring (italic) bila pernyataan tertentu boleh berada pada deretan lain. Sementara urutan yang HARUS berada pada urutan tertentu tulis dalam huruf tegak (biasa)
snytax nya ;
#include <iostream>
#include <windows.h>
#include <conio.h>
#include <stdio.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;
void satuan(int x) {
if (x==1) cout<<"Satu ";
else if(x==2) cout<<"Dua ";
else if(x==3) cout<<"Tiga ";
else if(x==4) cout<<"Empat ";
else if(x==5) cout<<"Lima ";
else if(x==6) cout<<"Enam ";
else if(x==7) cout<<"Tujuh ";
else if(x==8) cout<<"Delapan ";
else if(x==9) cout<<"Sembilan ";
else if(x==10) cout<<"Sepuluh ";
else if(x==11) cout<<"Sebelas ";
}
void terbilang(long y)
{
if(y<=11) satuan(y);
else if((y>11) && (y<=19))
{
terbilang (y%10);
cout<<"Belas ";
}
else if ((y>=20)&&(y<=99))
{
terbilang(y/10);
cout<<"Puluh ";
terbilang(y%10);
}
else if((y>=100)&&(y<=199))
{
cout<<"Seratus ";
terbilang(y%100);
}
else if((y>=200)&&(y<=999))
{
terbilang(y/100);
cout<<"Ratus ";
terbilang(y%100);
}
else if((y>=1000)&&(y<=1999))
{
cout<<"Seribu ";
terbilang(y%1000);
}
else if((y>=2000)&&(y<=9999))
{
terbilang(y/1000);
cout<<"Ribu ";
terbilang(y%1000);
}
else if((y>=10000)&&(y<=99999))
{
terbilang(y/1000);
cout<<"Ribu ";
terbilang(y%1000);
}
else if((y>=100000)&&(y<=999999))
{
terbilang(y/1000);
cout<<"Ribu ";
terbilang(y%1000);
}
else if((y>=1000000)&&(y<=9999999))
{
terbilang((y/100000));
cout<<"Juta ";
terbilang((y%100000));
}
else if((y>10000000))
{
cout<<"eror";
}
}
int main(int argc, char** argv){
unsigned long nilai;
int tarik,setor,menu;
int saldo=5000000;
system ("cls");
char jawab;
menu:
system ("cls");
cout<<"|========================|"<<endl;
cout<<"| Bank BCA\t |"<<endl;
cout<<"|========================|"<<endl;
cout<<" Saldo Anda RP:"<<saldo<<endl;
cout<<"|========================|"<<endl;
cout<<"| Menu Transaksi\t |"<<endl;
cout<<"|========================|"<<endl;
cout<<"|1) Setor Tabungan\t |"<<endl;
cout<<"|2) Ambil Tabungan\t |"<<endl;
cout<<"|3) Exit\t\t |"<<endl;
cout<<"|========================|"<<endl;
cout<<" Pilih Menu 1/2/3 = ";cin>>menu;
if (menu==1){
system ("cls");
cout<<"|========================|"<<endl;
cout<<"| Menu Penyetoran\t |"<<endl;
cout<<"|========================|"<<endl;
cout<<" Jumlah Setor = RP.";cin>>setor;
cout<<"|========================|"<<endl;
saldo=saldo+setor;
nilai=saldo;
system ("cls");
cout<<"Jumlah Saldo = RP."<<saldo<<endl;
cout<<"Jumlah Setoran =RP. "<<endl;cout<<"RP .";
terbilang(nilai);
cout<<"\n========================================================"<<endl;
cout<<"\nApakah Anda Ingin Melakukan Transaksi Lagi (Y/T) =";
cin>>jawab;
while(jawab=='Y'||jawab=='y'){
goto menu;
}
system ("cls");
cout<<"Trima Kasih!!!";
}else if(menu==2){
system ("cls");
cout<<"|========================|"<<endl;
cout<<"| Menu Penarikan |"<<endl;
cout<<"|========================|"<<endl;
cout<<" Jumlah Penarikan = RP.";cin>>tarik;
saldo=saldo-tarik;
nilai=tarik;
system ("cls");
cout<<"Jumlah Saldo :RP. "<<saldo<<endl;
cout<<"JUmlah Penarikan RP. "<<tarik<<endl;cout<<"RP .";
terbilang(nilai);
cout<<"\nApakah Anda Ingin Melakukan Transaksi Lagi (Y/T) =";
cin>>jawab;
while(jawab=='Y'||jawab=='y'){
goto menu;
}
system ("cls");
cout<<"Trima Kasih!!!";
}else {
system ("cls");
cout<<endl;
cout<<"Maaf Menu yang Anda Masukan Tidak Terdeteksi"<<endl;
cout<<"Apakah Anda Ingin Kembali ke Menu Transaksi (Y/T) =";
cin>>jawab;
while(jawab=='Y'||jawab=='y'){
goto menu;
}
system ("cls");
cout<<"Trima Kasih!!!";
}
return 0;
}
Ini hasil program nya ;
Jika kita memilih 1, maka kita setor tabungan. Dan kita masukan jumlah uang yang ingin di masukan ;
Jika kita ingin melanjutkan tekan huruf “Y”, jika tidak tekan huruf “T”.
Jika sudah berhasil saat nya kita bisa "Terima kasih" hahahaaa
My kelompok ; salahhudin = http://www.dindin96.id/
Aji sentosa putra = http://sentosa-aji.blogspot.co.id/
Tidak ada komentar:
Posting Komentar