Write Java program to allow the user to input the amount of deposit, yearly interest rate (percentage), and income tax(percentage). Then the program will calculate the amount of interest that the person earns in the year. See the example output below: The amount of deposit: 10000 Yearly interest rate: 7.5%

Respuesta :

ijeggs

Answer:

import java.util.Scanner;

public class num12 {

   public static void main(String[] args) {

       Scanner scr = new Scanner(System.in);

       System.out.println("Enter a Deposit Amount");

       double amt = scr.nextDouble();

       System.out.println("Income tax in percentage");

       double incomeTaxRate = scr.nextDouble()/100;

       System.out.println("Yearly interest rate:");

       double rate = scr.nextDouble();

       double intRate = rate/100;

       double interest = (amt*intRate)-(amt*incomeTaxRate);

       System.out.println("The Interest on "+amt+" at "+rate+"% after one year is "+interest);

   }

}

Explanation:

Find the sample output attached

Java's Scanner class is used to prompt and receive values for deposit amount, income tax rate and interest rate

The yearly interest is calculate by interest = (amt*intRate)-(amt*incomeTaxRate);

Ver imagen ijeggs