Computer Science, asked by amaljose1990, 7 months ago

M
Write a program
to find the simple
interest and amount
by using InputStream
Reader​

Answers

Answered by lugie
0

Answer:

import java.io.*;  

public class SimpleInt {

public static void main(String args[])throws Exception{      

InputStreamReader ir=new InputStreamReader(System.in);  

BufferedReader br=new BufferedReader(ir);  

System.out.println("Enter Principal amount");

String p=br.readLine();

double P=Double.parseDouble(p);

System.out.println("Enter Number of years");

String n=br.readLine();

double N=Double.parseDouble(n);

System.out.println("Interest Rate");

String r=br.readLine();

double R=Double.parseDouble(r);

double simpleInterest=(P*N*R)/100;

double amt=simpleInterest+P;

System.out.println("Simple Interest ="+simpleInterest);    

System.out.println("Amount = "+amt);

}  

}  

Hope it Helps ..:-)

Similar questions