Untitled

mail@pastecode.io avatar
unknown
plain_text
10 days ago
494 B
5
Indexable
Never
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);
	}
}

Leave a Comment