Sie sind auf Seite 1von 2

Program # 5

Aim :- Write a program take input using BufferedReader class. Coding :class Prog5 { public static void main(String args[]) { BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in));

try{ float amount,rate; int time; System.out.print("Enter Amount :\t"); amount=Float.parseFloat(stdin.readLine()); System.out.print("\nEnter rate :\t"); rate=Float.parseFloat(stdin.readLine()); System.out.print("\nEnter time :\t"); time=Integer.parseInt(stdin.readLine()); stdin.close(); System.out.print("\nIntrest is :\t"+(amount*rate*time)/100);

} catch(IOException e){ e.printStackTrace(); } } }

Output :Enter Amount : Enter rate : Enter time : Intrest is : 13 3 468.0 1200

Das könnte Ihnen auch gefallen