Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A private int data field named id for the account. A private double data field named balance for the account. A private double static data

A private int data field named id for the account.

A private double data field named balance for the account.

A private double static data field named annualInterestRate that stores the current interest rate.

A private Date data field named dateCreated that stores the date when the account was created.

A constructor that creates an account with the specified id and initial balance.

Accessor methods (get) for id, balance and annualInterestRate.

A mutator method (set) for annualInterestRate.

The accessor method for dateCreated.

A method named getMonthlyInterest() that returns the monthly interest rate.

A method named withdraw that withdraws a specified amount from the account.

A method named deposit that deposits a specified amount from the account.

image text in transcribed

import java.util.Scanner; import java.text.DecimalFormat; public class BankAcctDemo { public static void main (String[] args) { int acctID; double acctBalance, annIntRate, withAmt, depAmt; Scanner input = new Scanner(System.in); DecimalFormat twoDigits = new DecimalFormat("$###,###.00"); DecimalFormat percent = new DecimalFormat("##.00%"); System.out.println(" Bank Account Balance"); System.out.println(); System.out.print("Enter your account id: "); acctID = input.nextInt(); System.out.println(); System.out.print("Enter your current Balance: "); acctBalance = input.nextDouble(); System.out.println(); System.out.print("Enter your annual interest rate: "); annIntRate = input.nextDouble(); System.out.println(); System.out.print("Enter any withdrawals: "); withAmt = input.nextDouble(); System.out.println(); System.out.print("Enter any deposits: "); depAmt = input.nextDouble(); System.out.println(); CheckAcct account = new CheckAcct(acctID, acctBalance); CheckAcct.setAnnualInterestRate(annIntRate); account.withdraw(withAmt); account.deposit(depAmt); System.out.println("Balance for account # " + account.getId() + " is " +twoDigits.format(account.getBalance())); System.out.println("Monthly interest is " + twoDigits.format(account.getMonthlyInterest())); System.out.println("This account was created at " + account.getDateCreated()); System.out.println(); System.out.println(); System.out.println("Annual interest rate is " + percent.format(CheckAcct.getAnnualInterestRate())); } } 
CAWINDOWS1system32)cmd.exe Bank Account Balance Enter your account id: 1122 Enter your current Balance: 28888 Enter your annual interest rate: .045 Enter any withdraals: 2500 Enter any deposits: 300 Balance for account # 1122 is $17,800 .00 Monthly interest is $66.75 This account was created at Wed Nov 02 11:05:02 EDT 2016 Annual intere st rate is 4.50% Press any key to continue

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

=+The Mythical Man Month, as suggested in Further Reading.)

Answered: 1 week ago

Question

a score of 70 or higher on the test?

Answered: 1 week ago