ICSE Class 9 Computer Applications
Question 11 of 13
Input in Java — Question 11
Back to all questions 11
Question Question 11
Write a program in Java that uses 'input using initialisation' to calculate the Simple Interest and the Total Amount with the given values:
i. Principle Amount = Rs. 20000
ii. Rate = 8.9%
iii. Time = 3 years
public class KboatInterest
{
public static void main(String args[]) {
int p = 20000;
double r = 8.9;
int t = 3;
double si = p * r * t / 100.0;
double amt = p + si;
System.out.println("Simple Interest = " + si);
System.out.println("Total Amount = " + amt);
}
}Output
