In: Computer Science
Java Using NetBean
Calculate the interest for a bank account. Your program should use Scanner to collect account balance and interest rate (input 2.5 for 2.5%), and then output the interest should be paid.
interest = balance * interest_rate;
I have written the program using JAVA PROGRAMMING LANGUAGE.
OUTPUT :
CODE :
//imported the all module in util
import java.util.*;
//main class
class Main {
//main method
public static void main(String[] args) {
//declared the required double variables
double balance,interst_rate;
//scanner object
Scanner scan = new Scanner(System.in);
System.out.print("Enter the balance amount in your account : ");
balance = scan.nextDouble();//taking balance
System.out.print("Enter the interst rate of your bank : ");
//taking interest rate from the user
interst_rate = scan.nextDouble();
//To print the output on the console
System.out.println("\nOUTPUT : \nTotal Interest is value : " + balance*(interst_rate/100) );
}
}
Thanks..