Question

In: Computer Science

Java Using NetBean Calculate the interest for a bank account. Your program should use Scanner to...

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;

Solutions

Expert Solution

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..


Related Solutions

User the Scanner class for your input Write a java program to calculate the area of...
User the Scanner class for your input Write a java program to calculate the area of a rectangle. Rectangle Area is calculated by multiplying the length by the width   display the output as follow: Length =   Width = Area = Load: 1. Design (Pseudocode ) 2. Source file (Java file, make sure to include comments) 3. Output file (word or pdf or jpig file)
In Java INSTRUCTIONS Write a java program called InputValidation.java that will use Scanner to ask the...
In Java INSTRUCTIONS Write a java program called InputValidation.java that will use Scanner to ask the computer user to enter his/her: • Name: a string representing the user’s first name • month of birthday: an integer representing the month of the user’s birthday • day of birthday: an integer representing the day of the user’s birthday • year of birthday: an integer representing the year of the user’s birthday Consider the following aspects that your program shall perform: VALIDATE USER’S...
3) Create a Java program that uses NO methods, but use scanner: Write a program where...
3) Create a Java program that uses NO methods, but use scanner: Write a program where you will enter the flying distance from one continent to another, you will take the plane in one country, then you will enter miles per gallon and price of gallon and in the end it will calculate how much gas was spend for that distance in miles. Steps: 1) Prompt user to enter the name of country that you are 2) Declare variable to...
In java. Using a linked list only, iterator and scanner. Develop a program to maintain a...
In java. Using a linked list only, iterator and scanner. Develop a program to maintain a Linked List of homework assignments name and due date. When an assignment is assigned, add it to the list, and when it is completed, remove it. You should keep track of the due date. Your program should provide the following services each contained within its own method: Add a new assignment. (3 pts) Remove an assignment. (3pts) Provide a list of the assignments in...
JAVA PROGRAM: Creates a Bank Account class with one checking account and methods to withdraw and...
JAVA PROGRAM: Creates a Bank Account class with one checking account and methods to withdraw and deposit. Test the methods in the main function.
Calculate Interest in a Java program. If you know the balance and the annual percentage interest...
Calculate Interest in a Java program. If you know the balance and the annual percentage interest rate, you can compute the interest on the next monthly payment using the following formula: interest = balance * (annualInterestRate/1200) Write a program that reads the balance and the annual percentage interest rate and displays the interest for the next month. Create a scanner Prompt the user to enter a name and create variable for scanner Prompt the user to enter a balance and...
In java Create a program to calculate interest rate and total balance - the program consists...
In java Create a program to calculate interest rate and total balance - the program consists of (a) A class that encapsulates the interest rate and total balance calculation Constructor should accept initial balance and interest rate Methods: Returns interest rate Returns total balance Set interest rate Set initial balance (b) A test program that uses class from step (A) to perform the following: Set interest rate to 5% and initial balance to 1000 Print interest amount and total balance...
using java write a program As the title described, you should only use two stacks to...
using java write a program As the title described, you should only use two stacks to implement a queue's actions. DO NOT use any other data structure and push, pop and top should be O(1) by AVERAGE. The queue should support push(element), pop() and top() where pop is pop the first(a.k.a front) element in the queue. Both pop and top methods should return the value of first element example push(1) pop() // return 1 push(2) push(3) top() // return 2...
8) Create the following program using Java. Circle calculation using methods Create scanner declare double variable...
8) Create the following program using Java. Circle calculation using methods Create scanner declare double variable radius = -999 declare character choice create do while loop inside of do loop write: System.out.println(); System.out.println("*** CIRCLE CALCULATIONS ***"); System.out.println(); System.out.println("1. Enter the radius of the circle"); System.out.println("2. Display the area of the circle"); System.out.println("3. Display the circumference of the circle"); System.out.println("4. Quit"); System.out.println(); System.out.println("Enter a number from 1 - 4"); System.out.println(); Declare choice character and relate to scanner declare switch (choice) case...
Java How to read a comma separated value file using Scanner for example Scanner sc =...
Java How to read a comma separated value file using Scanner for example Scanner sc = new Scanner(filename); I need to assign each value separated by a comma to different variable types. I need a good example to know how it works and implement it in my project Please only use Scanner to read the file
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT