BERIKUT CODING VERSI FAUZI ONLINE
Nama File : NasabahBank.java
import java.io.*;
class BankRecord{
public String[] no=new String [100];
public String[] nama=new String [100];
public String[] jenis=new String [100];
public String[] saldo=new String [100];
public static int indek;
public int jumlah_saldo;
public String getNo(int indek){
return no[indek];
}
public String getNama(int indek){
return nama[indek];
}
public String getJenis(int indek){
return jenis[indek];
}
public String getSaldo(int indek){
return saldo[indek];
}
public int getJumlah_saldo(){
return jumlah_saldo;
}
public void setJumlah_saldo(int index){
jumlah_saldo=Integer.parseInt(saldo[index])+jumlah_saldo;
}
public void setResult( String no1 ,int indek,String nama1,String jenis1,String saldo1){
no[indek] = no1;
nama[indek] = nama1;
jenis[indek] = jenis1;
saldo[indek] = saldo1;
}
}
public class NasabahBank extends BankRecord{
public static void main( String[] args ) throws Exception{
BufferedReader dataIn=new BufferedReader(new InputStreamReader(System.in));
int count=0;
BankRecord databank = new BankRecord();
for(int i=1; i<3+1; i++ ){
System.out.println("data nasabah ke "+i);
System.out.println("====================");
System.out.print("No : ");
databank.no[i]=dataIn.readLine();
System.out.print("Nama : ");
databank.nama[i]=dataIn.readLine();
System.out.print("Jenis tabungan ==> Input D (UNTUK DEPOSITO) atau R (UNTUK REGULAR)\nInput Jenis Tabungan : ");
databank.jenis[i]=dataIn.readLine();
System.out.print("saldo : ");
databank.saldo[i]=dataIn.readLine();
}
for(int i=1;i<3+1;i++){
databank.setResult(databank.no[i],i,databank.nama[i],databank.jenis[i],databank.saldo[i]);
databank.setJumlah_saldo(i);
}
for(int i=1;i<3+1;i++){
if(databank.getJenis(i).equals("D")||databank.getJenis(i).equals("d") ){
count=count+1;
}
}
System.out.println("\nLAPORAN BANK FAUZI ONLINE");
System.out.println("\njumlah nasabah deposito : "+count);
System.out.println("jumlah nasabah reguler : "+(3-count));
System.out.println("total saldo seluruh nasabah : "+databank.getJumlah_saldo());
}
}
Powered By:
Fajrul Islam Universitas Gunadarma || Heru Hartanto || Andry YP || Semua Teman-teman 3KA01 Ytc
Semangat !!
PROGRAM KLINIK {JAVA}: COMING SOON :)
makasiih..
ReplyDeletebermanfaat share nya..
keep sharing.. ;)