Computer Applications

An employee wants to deposit 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 DaysRate of Interest
Up to 180 days5.5%
181 to 364 days7.5%
Exact 365 days9.0%
More than 365 days8.5%

Write a program to calculate the maturity amount taking the sum and number of days as inputs.

Java

Java Conditional Stmts

111 Likes

Answer

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);
    }
}

Variable Description Table

Program Explanation

Output

Answered By

40 Likes


Related Questions