Computer Science, asked by sagnikmajumder35, 1 day ago

A bank is offering different rate of interest on fixed deposits based on the duration of investment as follows:

TIME : Rate p.a :
Up to 1 year 5%
>1 year up to 3 years 5.5%
>3 years 5.25%

Write a program to assign the principal amount and time if duration (in years) and display the final amount the bank will pay to the customer.
A = P(1+R/100)T​​

Answers

Answered by akolkarkalpana48
0

Explanation:

it is a correct answer this question

Attachments:
Answered by ItzMeSam35
2

import java.util.*;

public class Interest

{

public static void main (String args [])

{

Scanner sc=new Scanner(System.in);

System.out.println("Please Enter The Principle Amount");

double P = sc.nextDouble();

System.out.println("Please Enter The Time Span");

double T = sc.nextDouble();

if ( T == 1)

{

double R = 5;

double A = P * (Math.pow((1 + (R/100)) , T));

double CI = A - P ;

double V = P + CI;

System.out.println("Compound Interest on "+P+" At Rate "+R+" For Time "+T+" = "+CI);

System.out.println("Total = "+V);

}

else if ( T > 1 && T <= 3)

{

double R = 5.5;

double A = P * (Math.pow((1 + (R/100)) , T));

double CI = A - P ;

double V = P + CI;

System.out.println("Compound Interest on "+P+" At Rate "+R+" For Time "+T+" = "+CI);

System.out.println("Total = "+V);

}

else if ( T > 3 )

{

double R = 5.25;

double A = P * (Math.pow((1 + (R/100)) , T));

double CI = A - P ;

double V = P + CI;

System.out.println("Compound Interest on "+P+" At Rate "+R+" For Time "+T+" = "+CI);

System.out.println("Total = "+V);

}

sc.close();

}

}

Similar questions