Untitled
unknown
plain_text
2 years ago
494 B
12
Indexable
public class compound {
public static void main (String[] args){
float principle = Float.parseFloat(args[0]);
float rate = Float.parseFloat(args[1]);
float year = Float.parseFloat(args[2]);
float amount = principle ;
for (int i = 0; i < year; i++) {
float interest_per_year = (amount * rate * 1)/100 ;
amount += interest_per_year;
}
System.out.println("Total Money you have to pay on "+principle+" for "+year+" years at the rate of "+rate+" per annum is Rs "+amount);
}
}
Editor is loading...
Leave a Comment