Saturday, April 23, 2011

Calculate interest and investment in java

Calculating Investment and bank interest may be thought of difficult and complicated, but this time I'll share a little about how to make the program
For this program I'm using JCreator Version 4:50 for those who use other programs can adapt.

Let us write codingnya,


import java.io.*;
class inputBilangan
{
   public static void main(String[]args)throws IOException


        String temp;
            double  bilangan;
        double pokok;   
        double sukubunga;
        double bunga;
        double total;


    InputStreamReader isr = new InputStreamReader(System.in);   
    BufferedReader bil = new BufferedReader (isr);

  System.out.print(" Saldo Rekening Anda: ");         

    temp = bil.readLine();
    bilangan = Integer.parseInt(temp);
   
   
        sukubunga = 0.10;    // sama dengan 10%
        bunga = bilangan * sukubunga;

        total = bilangan + bunga;
   
 
System.out.println("\n Saldo yang anda inputkan " + "adalah  : " + bilangan);  
System.out.println(" Bunga yang dihasilkan " + "adalah     : " + bunga);  
System.out.println(" Investasi selama 1 tahun " + "adalah  : " + total);   
  }
}



and it looks like this will be





hopefully useful

No comments:

Post a Comment