Computer Science, asked by saisurajdey13, 9 hours ago

An employee wants to deposit a certain sum of money under 'Term Deposit' scheme in Syndicate Bank. The bank has provided the tariff of the scheme, which is given below:

No. of Days Rate of Interest
Up to 180 days 5.5%
181 to 364 days 7.5%
Exact 365 days 9.0%
More than 365 days 8.5%
Write a program to calculate the maturity amount taking the sum and number of days as inputs.

Answers

Answered by devindersaroha43
2

Answer:

Explanation:

import java.util.Scanner;

public class KboatTermDeposit

{

   public static void main(String args[]) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter sum of money: ");

       double sum = in.nextDouble();

       System.out.print("Enter number of days: ");

       int days = in.nextInt();

       double interest = 0.0;

       

       if (days <= 180)

           interest = sum * 5.5 / 100.0;

       else if (days <= 364)

           interest = sum * 7.5 / 100.0;

       else if (days == 365)

           interest = sum * 9.0 / 100.0;

       else

           interest = sum * 8.5 / 100.0;

           

       double amt = sum + interest;

       

       System.out.print("Maturity Amount = " + amt);

Similar questions