Created
November 19, 2015 12:51
-
-
Save mahnve/e69f226f80568e01511f to your computer and use it in GitHub Desktop.
This file contains 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
class Arithmetic { | |
public double calculateInterest(int initialAmount, double interest, int years) { | |
double cumulativeInterest = Math.pow((1 + interest), years); | |
return cumulativeInterest * initialAmount; | |
} | |
public static void main(String args[]) { | |
Arithmetic arithmetic = new Arithmetic(); | |
double sum = arithmetic.calculateInterest(Integer.parseInt(args[0]), | |
Double.parseDouble(args[1]), | |
Integer.parseInt(args[2])); | |
System.out.println(sum); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment