MR_Whitehat

Banking - Recurring Deposit Account

Mar 27th, 2020
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1. package com.akshat.number_programs;
  2. //PROGRAM DEVELOPED BY AKSHAT DODHIYA
  3. import java.io.*;
  4.  
  5. public class Banking {
  6.     public static void main(String[] args)throws IOException {
  7.         InputStreamReader isr=new InputStreamReader(System.in);
  8.         BufferedReader br=new BufferedReader(isr);
  9.  
  10. //      taking inputs
  11.  
  12.         System.out.println("Enter sum deposited every month");
  13.         int p = Integer.parseInt(br.readLine());
  14.  
  15.         System.out.println("Enter the number of months for which the sum is invested");
  16.         int n = Integer.parseInt(br.readLine());
  17.         int n1 = n + 1;
  18.  
  19.         System.out.println("Enter the rate of interest for which the sum is invested");
  20.         int rate = Integer.parseInt(br.readLine());
  21.         double r = rate/100.0;
  22.  
  23.         double maturity, interest ;
  24.  
  25.         interest = p*(n*(n1)/24.0)*r; // formula for interest
  26.         maturity = (p * n) + interest; // formula for maturity value
  27.  
  28.         System.out.println("The Maturity after "+n+" months will be "+maturity);
  29.         System.out.println("The Interest fetched in "+n+" months at "+rate+
  30.                 "% interest rate will be "+interest);
  31.  
  32.     }
  33. }
Add Comment
Please, Sign In to add comment