Question 71 : Write a program in Java to find out Compound Interest (C. I.) on the basis of inputs accepted from the user.
Java Program :
import java.io.*;
class compound_interest
{
static void main()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
double p,r,t,a=0,n;
System.out.println("\t\t*****Input Data*****\n");
System.out.print("Enter the principal amount : Rs. ");
p=Double.parseDouble(br.readLine());
System.out.print("\nEnter the rate of interest (w/o % sign) : ");
r=Double.parseDouble(br.readLine());
System.out.print("\nEnter the time in yrs. : ");
t=Double.parseDouble(br.readLine());
System.out.print("\nHow many times a year is the interest calculated (Ex.: Half-yearly : 2 times) ? : ");
n=Double.parseDouble(br.readLine());
a=p*(Math.pow((1+(r/(n*100))),(t*n)));
System.out.println("\n\t\t*****Results*****\n");
System.out.println("Compound interest : Rs. "+(a-p));
System.out.println("\nAmount : Rs. "+a);
}
}
Java Program :
import java.io.*;
class compound_interest
{
static void main()throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
double p,r,t,a=0,n;
System.out.println("\t\t*****Input Data*****\n");
System.out.print("Enter the principal amount : Rs. ");
p=Double.parseDouble(br.readLine());
System.out.print("\nEnter the rate of interest (w/o % sign) : ");
r=Double.parseDouble(br.readLine());
System.out.print("\nEnter the time in yrs. : ");
t=Double.parseDouble(br.readLine());
System.out.print("\nHow many times a year is the interest calculated (Ex.: Half-yearly : 2 times) ? : ");
n=Double.parseDouble(br.readLine());
a=p*(Math.pow((1+(r/(n*100))),(t*n)));
System.out.println("\n\t\t*****Results*****\n");
System.out.println("Compound interest : Rs. "+(a-p));
System.out.println("\nAmount : Rs. "+a);
}
}
mahirap
ReplyDeleteit doesnt work dumb nimbscles
ReplyDeleteNice.program and easy to unferstand thanku
ReplyDeleteCan't understand
ReplyDeleteCan't understand
ReplyDeleteCan't understand
ReplyDeletekuşadası
ReplyDeletefethiye
sivas
samsun
mugla
S5J5
betturkey
ReplyDeletesex hattı
https://izmirkizlari.com
sms onay
NEKSSC