Back To Java User Defined Methods Index
//program to create a function that calculates compound interest based on principal amount, rate of interest and time passed to the function as arguments class ci { public void calccint(int p,int r,int t) { double ci; ci=(p*Math.pow(1+(r/100),t)); System.out.println("\ncompound interest is " + ci); } } public class calcci { public static void main(String[] args) { ci ob=new ci(); ob.calccint(1000,3,5); } }