lawang code

lawang Code


Tanyakan kode disini

tanya kalkulator financial

ditanyakan oleh imam 3 tahun yang lalu

image alt

mau tanya nie gan untuk membuat hasil yang nantinya seperti di gambar itu gimana gan soalnya untuk tiap bulanya ane error ane manual soalnya trus ane up ke 12 bulan error ga mau keluar semua gimana ya sapa tau ada yang bisa membantu untuk source code nya gan trimakasih :)

Menampilkan 1-6 dari 6 hasil
handita okviyanto menjawab 3 tahun yang lalu :

Errornya gimana ya? bisa di jelasin lebih detil.?

Buat aja model datanya misalnya

    public class Bunga{
    public int hari;
    public int bunga;
    public int awal;
    public int getJumlah(){
        return bunga+awal;
    }
}

public class BungaActivity extends Activity{
    ...
    public List<Bunga> listBunga;
    public void init(){
        int totalHari=30;
        int bunga=0.5;
        int awal=30;
       for(int i=1;i<=totalHari;i++){
            Bunga bunga=new Bunga();
            bunga.hari=i;
            bunga.awal=awal;
            bunga.bunga=awal*bunga;
            awal=bunga.getJumlah();
            listBunga.add(new Bunga());
       }
    }
    ...
}

Terus set aja listbunga ke adapter di listviewnya


imam menjawab 3 tahun yang lalu :

ini file

deposito.java

package com.imam;
//import java.lang.reflect.Array;

//import android.R.array;
//import android.R.integer;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class deposito extends Activity{
    Button hitung;
    EditText bulan,bunga,nominal;
    TextView hasilbulan,hasilawal,hasilbunga,hasilsaldo;
    Integer hasil1,hasil2,hasil3,hasil4,hasil5,hasil6,hasil7,hasil8,hasil9,hasil10,hasil11,hasil12,hasil13;


protected void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.deposito);
        hitung=(Button)findViewById(R.id.btndepo1);
        bunga=(EditText)findViewById(R.id.edtbunga);
        bulan=(EditText)findViewById(R.id.edtbulan);
        nominal=(EditText)findViewById(R.id.edtnominal);
        hasilbulan=(TextView)findViewById(R.id.hasilbulan);
        hasilawal=(TextView)findViewById(R.id.hasilawal);
        hasilbunga=(TextView)findViewById(R.id.hasilbunga);
        hasilsaldo=(TextView)findViewById(R.id.hasilsaldo);


        hitung.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View arg0) {
                double bunga1 = Double.parseDouble(bunga.getText().toString());
                int bulan1 = Integer.parseInt(bulan.getText().toString());
                int nom1 = Integer.parseInt(nominal.getText().toString());
                int hbunga = (int) ((nom1* bunga1/100)/12*80/100);  
                int hasil=nom1+hbunga;
                //int arrbulan[]=(int) 12;
                //StringBuilder sb = new StringBuilder();
                //int bln[]=new int[12];

                //int[] bln={1,2,3,4,5};



                for(int i=1;i<=bulan1;i++){



            //sb.append(i);

            //hasilbulan.setText(sb.toString());
            //hasilbulan.append(bln[i]);
                    //hasil awal

                    int awal2=hasil;
                    int awal3=hasil1;
                    int awal4=hasil4;
                    int awal5=hasil5;
                    int awal6=hasil6;
                    int awal7=hasil7;
                    int awal8=hasil8;
                    int awal9=hasil9;
                    int awal10=hasil10;
                    int awal11=hasil11;
                    int awal12=hasil12;



                    //hitung bunga

                    int bunga2=(int)((nom1* bunga1/100)/12*80/100);
                    int bunga3=(int)((hasil2* bunga1/100)/12*80/100);
                    int bunga4=(int)((hasil3* bunga1/100)/12*80/100);
                    int bunga5=(int)((hasil4* bunga1/100)/12*80/100);
                    int bunga6=(int)((hasil5* bunga1/100)/12*80/100);
                    int bunga7=(int)((hasil6* bunga1/100)/12*80/100);
                    int bunga8=(int)((hasil7* bunga1/100)/12*80/100);
                    int bunga9=(int)((hasil8* bunga1/100)/12*80/100);
                    int bunga10=(int)((hasil9* bunga1/100)/12*80/100);
                    int bunga11=(int)((hasil10* bunga1/100)/12*80/100);
                    int bunga12=(int)((hasil11* bunga1/100)/12*80/100);
                    int bunga13=(int)((hasil12* bunga1/100)/12*80/100);

                    //hasil bunga

                    hbunga= bunga2;
                    int hbunga1=bunga3;
                    int hbunga2=bunga4;
                    int hbunga3=bunga5;
                    int hbunga4=bunga6;
                    int hbunga5=bunga7;
                    int hbunga6=bunga8;
                    int hbunga7=bunga9;
                    int hbunga8=bunga10;
                    int hbunga9=bunga11;
                    int hbunga10=bunga12;
                    int hbunga11=bunga13;

                    //perhitungan saldo
                    int hasil2=nom1+hbunga;
                    int hasil3=hasil2+hbunga1;
                    int hasil4=hasil3+hbunga2;
                    int hasil5=hasil4+hbunga3;
                    int hasil6=hasil5+hbunga4;
                    int hasil7=hasil6+hbunga5;
                    int hasil8=hasil7+hbunga6;
                    int hasil9=hasil8+hbunga7;
                    int hasil10=hasil9+hbunga8;
                    int hasil11=hasil10+hbunga9;
                    int hasil12=hasil11+hbunga10;
                    int hasil13=hasil12+hbunga11;

                    //hasil saldo
                    hasil=hasil2;
                    int hasill1=hasil3;
                    int hasill2=hasil4;
                    int hasill3=hasil5;
                    int hasill4=hasil6;
                    int hasill5=hasil7;
                    int hasill6=hasil8;
                    int hasill7=hasil9;
                    int hasill8=hasil10;
                    int hasill9=hasil11;
                    int hasill10=hasil12;
                    int hasill11=hasil13;

                    if (bulan1<=1) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1));
                        hasilbunga.setText(String.valueOf(hbunga));
                        hasilsaldo.setText(String.valueOf(hasil));
                    }else if (bulan1<=2) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1));
                    }else if (bulan1<=3) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2+"\n"+awal3));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1+"\n"+hasill2));
                    }else if (bulan1<=4) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2+"\n"+awal3+"\n"+awal4));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1+"\n"+hasill2+"\n"+hasill3));
                    }else if (bulan1<=5) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2+"\n"+awal3+"\n"+awal4+"\n"+awal5));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1+"\n"+hasill2+"\n"+hasill3+"\n"+hasill4));
                    }else if (bulan1<=6) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2+"\n"+awal3+"\n"+awal4+"\n"+awal5+"\n"+awal6));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1+"\n"+hasill2+"\n"+hasill3+"\n"+hasill4+"\n"+hasill5));
                    }else if (bulan1<=7) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2+"\n"+awal3+"\n"+awal4+"\n"+awal5+"\n"+awal6+"\n"+awal7));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1+"\n"+hasill2+"\n"+hasill3+"\n"+hasill4+"\n"+hasill5+"\n"+hasill6));
                    }else if (bulan1<=8) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2+"\n"+awal3+"\n"+awal4+"\n"+awal5+"\n"+awal6+"\n"+awal7+"\n"+awal8));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6+"\n"+hbunga7));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1+"\n"+hasill2+"\n"+hasill3+"\n"+hasill4+"\n"+hasill5+"\n"+hasill6+"\n"+hasill7));
                    }else if (bulan1<=9) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2+"\n"+awal3+"\n"+awal4+"\n"+awal5+"\n"+awal6+"\n"+awal7+"\n"+awal8+"\n"+awal9));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6+"\n"+hbunga7+"\n"+hbunga8));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1+"\n"+hasill2+"\n"+hasill3+"\n"+hasill4+"\n"+hasill5+"\n"+hasill6+"\n"+hasill7+"\n"+hasill8));
                    }else if (bulan1<=10) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2+"\n"+awal3+"\n"+awal4+"\n"+awal5+"\n"+awal6+"\n"+awal7+"\n"+awal8+"\n"+awal9+"\n"+awal10));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6+"\n"+hbunga7+"\n"+hbunga8+"\n"+hbunga9));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1+"\n"+hasill2+"\n"+hasill3+"\n"+hasill4+"\n"+hasill5+"\n"+hasill6+"\n"+hasill7+"\n"+hasill8+"\n"+hasill9));
                    }else if (bulan1<=11) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2+"\n"+awal3+"\n"+awal4+"\n"+awal5+"\n"+awal6+"\n"+awal7+"\n"+awal8+"\n"+awal9+"\n"+awal10+"\n"+awal11));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6+"\n"+hbunga7+"\n"+hbunga8+"\n"+hbunga9+"\n"+hbunga10));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1+"\n"+hasill2+"\n"+hasill3+"\n"+hasill4+"\n"+hasill5+"\n"+hasill6+"\n"+hasill7+"\n"+hasill8+"\n"+hasill9+"\n"+hasill10));
                    }else if (bulan1<=12) {
                        hasilbulan.append(i+"\n");
                        hasilawal.setText(String.valueOf(nom1+"\n"+awal2+"\n"+awal3+"\n"+awal4+"\n"+awal5+"\n"+awal6+"\n"+awal7+"\n"+awal8+"\n"+awal9+"\n"+awal10+"\n"+awal11+"\n"+awal12));
                        hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6+"\n"+hbunga7+"\n"+hbunga8+"\n"+hbunga9+"\n"+hbunga10+"\n"+hbunga11));
                        hasilsaldo.setText(String.valueOf(hasil+"\n"+hasill1+"\n"+hasill2+"\n"+hasill3+"\n"+hasill4+"\n"+hasill5+"\n"+hasill6+"\n"+hasill7+"\n"+hasill8+"\n"+hasill9+"\n"+hasill10+"\n"+hasill11));
                    }





                }

            }
        });



    }
}

dan ini file deposito.xml

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ac"
android:layout_width="match_parent"
android:layout_height="match_parent"

android:orientation="vertical" >


 <EditText
      android:id="@+id/edtnominal"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:hint="Nominal"
      android:ems="10" >


  </EditText>
 <EditText
      android:id="@+id/edtbunga"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
       android:hint="Bunga"
      android:ems="10" >

  </EditText>
              <EditText
      android:id="@+id/edtbulan"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
       android:hint="Bulan"
      android:ems="10" >

  </EditText>

              <Button
                  android:id="@+id/btndepo1"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:text="hitung" />
     <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:background="#FFFFF0"
            android:text="Tabel Bunga :"
            android:textSize="22dp"
            android:textStyle="bold"
            android:width="1000dp" />
    </LinearLayout>



<ScrollView 
android:layout_width="fill_parent"
android:layout_height="fill_parent" 
 >

      <LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="wrap_content" >

 <TableLayout
     android:layout_width="53dp"
     android:layout_height="match_parent" >

    <TableRow
        android:id="@+id/tableRow1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >

        <TextView
            android:id="@+id/textView1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Bulan"
            android:textSize="15dp" />

    </TableRow>

    <TableRow
        android:id="@+id/tableRow2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" >
        <TextView
            android:id="@+id/hasilbulan"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=""
            android:textSize="15dp" />
    </TableRow>


</TableLayout>

<TableLayout
android:layout_width="90dp"
android:layout_height="match_parent" >

<TableRow 
        android:id="@+id/tableRow5"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
    <TextView
            android:id="@+id/textView2"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="awal(Rp.)"
            android:textSize="15dp" />
</TableRow>
<TableRow 
        android:id="@+id/tableRow6"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
    <TextView
            android:id="@+id/hasilawal"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=""
            android:textSize="15dp" />

</TableRow>


</TableLayout>

<TableLayout
android:layout_width="85dp"
android:layout_height="match_parent" >

<TableRow 
        android:id="@+id/tableRow9"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
    <TextView
            android:id="@+id/textView3"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Bunga(Rp.)"
            android:textSize="15dp" />
</TableRow>
<TableRow 
        android:id="@+id/tableRow10"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
    <TextView
            android:id="@+id/hasilbunga"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=""
            android:textSize="15dp" />
</TableRow>
</TableLayout>

<TableLayout
android:layout_width="90dp"
android:layout_height="266dp" >

<TableRow 
        android:id="@+id/tableRow13"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
    <TextView
            android:id="@+id/textView4"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Saldo(Rp.)"
            android:textSize="15dp" />
</TableRow>
<TableRow 
        android:id="@+id/tableRow14"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content">
    <TextView
            android:id="@+id/hasilsaldo"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text=""
            android:textSize="15dp" />

</TableRow>

</TableLayout>
      </LinearLayout>
   </ScrollView>




      </LinearLayout>




imam menjawab 3 tahun yang lalu :

itu program ane gan jika ada kesalahan mohon di koreksi... kalau ada email bis ane send filenya


handita okviyanto menjawab 3 tahun yang lalu :

Itu kenapa di deklarasiin satu satu..

                int awal2=hasil;
                int awal3=hasil1;
                int awal4=hasil4;
                int awal5=hasil5;
                int awal6=hasil6;
                int awal7=hasil7;
                int awal8=hasil8;
                int awal9=hasil9;
                int awal10=hasil10;
                int awal11=hasil11;
                int awal12=hasil12;

Dibikin List jaa.. diisi sesuai yang kamu mau misal

List<Integer> listAngka;
listAngka=new ArrayList<Integer>();
for(int i=0;i<100;i++){
  listAngka.add((int)((nom1* bunga1/100)/12*80/100));
}

Isi nom1 dan bunga1 variabel dinamis buat dilooping sesuai algoritmamu


imam menjawab 3 tahun yang lalu :

ane kmren di rubah tapi jadi stop close

protected void onCreate(Bundle savedInstanceState) {

    super.onCreate(savedInstanceState);
    setContentView(R.layout.deposito);
    hitung=(Button)findViewById(R.id.btndepo1);
    bunga=(EditText)findViewById(R.id.edtbunga);
    bulan=(EditText)findViewById(R.id.edtbulan);
    nominal=(EditText)findViewById(R.id.edtnominal);
    hasilbulan=(TextView)findViewById(R.id.hasilbulan);
    hasilawal=(TextView)findViewById(R.id.hasilawal);
    hasilbunga=(TextView)findViewById(R.id.hasilbunga);
    hasilsaldo=(TextView)findViewById(R.id.hasilsaldo);


    hitung.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {
            double bunga1 = Double.parseDouble(bunga.getText().toString());
            int bulan1 = Integer.parseInt(bulan.getText().toString());
            int nom1 = Integer.parseInt(nominal.getText().toString());
            int hbunga = (int) ((nom1* bunga1/100)/12*80/100);  
            int hasil=nom1+hbunga;
            //int arrbulan[]=(int) 12;
            //StringBuilder sb = new StringBuilder();
            //int bln[]=new int[12];

            //int[] bln={1,2,3,4,5};



            for(int i=1;i<=bulan1;i++){



        //sb.append(i);

        //hasilbulan.setText(sb.toString());
        //hasilbulan.append(bln[i]);
                //hasil awal

                //hitung bunga

                int bunga2=(int)((nom1* bunga1/100)/12*80/100);
                int bunga3=(int)((hasil2* bunga1/100)/12*80/100);
                int bunga4=(int)((hasil3* bunga1/100)/12*80/100);
                int bunga5=(int)((hasil4* bunga1/100)/12*80/100);
                int bunga6=(int)((hasil5* bunga1/100)/12*80/100);
                int bunga7=(int)((hasil6* bunga1/100)/12*80/100);
                int bunga8=(int)((hasil7* bunga1/100)/12*80/100);
                int bunga9=(int)((hasil8* bunga1/100)/12*80/100);
                int bunga10=(int)((hasil9* bunga1/100)/12*80/100);
                int bunga11=(int)((hasil10* bunga1/100)/12*80/100);
                int bunga12=(int)((hasil11* bunga1/100)/12*80/100);
                int bunga13=(int)((hasil12* bunga1/100)/12*80/100);

                //hasil bunga

                hbunga= bunga2;
                int hbunga1=bunga3;
                int hbunga2=bunga4;
                int hbunga3=bunga5;
                int hbunga4=bunga6;
                int hbunga5=bunga7;
                int hbunga6=bunga8;
                int hbunga7=bunga9;
                int hbunga8=bunga10;
                int hbunga9=bunga11;
                int hbunga10=bunga12;
                int hbunga11=bunga13;

                //perhitungan saldo
                int hasil2=nom1+hbunga;
                int hasil3=hasil2+hbunga1;
                int hasil4=hasil3+hbunga2;
                int hasil5=hasil4+hbunga3;
                int hasil6=hasil5+hbunga4;
                int hasil7=hasil6+hbunga5;
                int hasil8=hasil7+hbunga6;
                int hasil9=hasil8+hbunga7;
                int hasil10=hasil9+hbunga8;
                int hasil11=hasil10+hbunga9;
                int hasil12=hasil11+hbunga10;
                //int hasil13=hasil12+hbunga11;


                if (bulan1<=1) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1));
                    hasilbunga.setText(String.valueOf(hbunga));
                    hasilsaldo.setText(String.valueOf(hasil));
                }else if (bulan1<=2) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2));
                }else if (bulan1<=3) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2+"\n"+hasil3));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2+"\n"+hasil3));
                }else if (bulan1<=4) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4));
                }else if (bulan1<=5) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5));
                }else if (bulan1<=6) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6));
                }else if (bulan1<=7) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7));
                }else if (bulan1<=8) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7+"\n"+hasil8));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6+"\n"+hbunga7));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7+"\n"+hasil8));
                }else if (bulan1<=9) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7+"\n"+hasil8+"\n"+hasil9));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6+"\n"+hbunga7+"\n"+hbunga8));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7+"\n"+hasil8+"\n"+hasil9));
                }else if (bulan1<=10) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7+"\n"+hasil8+"\n"+hasil9+"\n"+hasil10));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6+"\n"+hbunga7+"\n"+hbunga8+"\n"+hbunga9));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7+"\n"+hasil8+"\n"+hasil9+"\n"+hasil10));
                }else if (bulan1<=11) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7+"\n"+hasil8+"\n"+hasil9+"\n"+hasil10+"\n"+hasil11));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6+"\n"+hbunga7+"\n"+hbunga8+"\n"+hbunga9+"\n"+hbunga10));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7+"\n"+hasil8+"\n"+hasil9+"\n"+hasil10+"\n"+hasil11));
                }else if (bulan1<=12) {
                    hasilbulan.append(i+"\n");
                    hasilawal.setText(String.valueOf(nom1+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7+"\n"+hasil8+"\n"+hasil9+"\n"+hasil10+"\n"+hasil11+"\n"+hasil12));
                    hasilbunga.setText(String.valueOf(hbunga+"\n"+hbunga1+"\n"+hbunga2+"\n"+hbunga3+"\n"+hbunga4+"\n"+hbunga5+"\n"+hbunga6+"\n"+hbunga7+"\n"+hbunga8+"\n"+hbunga9+"\n"+hbunga10+"\n"+hbunga11));
                    hasilsaldo.setText(String.valueOf(hasil+"\n"+hasil2+"\n"+hasil3+"\n"+hasil4+"\n"+hasil5+"\n"+hasil6+"\n"+hasil7+"\n"+hasil8+"\n"+hasil9+"\n"+hasil10+"\n"+hasil11+"\n"+hasil12));
                }





            }

        }
    });



}

}


imam menjawab 3 tahun yang lalu :

ane newbie soalnya gan gak tau gmn tuh ..... variable dinamis maksudnya gmn gan... coba samean oprek aj program yang ane buat soalnya yg ane buat biasanya bisa sampek 2 bulan tapi skrng ane hitung mesti stoped :'( tear


Anda harus login terlebih dahulu untuk memberikan komentar

Recent Tag

X 6
X 48
X 14
X 10
X 1
X 5
X 4
X 13
X 10

Bantuan

Help

Feedback

Help