Created
December 19, 2018 18:55
-
-
Save farhanpro/b2ba35095f682d245beb9e31c0eac573 to your computer and use it in GitHub Desktop.
intrest rate calculator using for loop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.company; | |
public class Main { | |
public static void main(String[] args) { | |
for(int i=0;i<5;i++){ | |
double solution = calculate_interst(10000d,i); | |
System.out.println("On " + i + "% it will be"); | |
System.out.println(solution + " $"); | |
} | |
} | |
public static double calculate_interst(double amount ,double intrest_rate ){ | |
//System.out.println(amount *(intrest_rate /100)); | |
return (amount*(intrest_rate/100)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment