Create a class named Account that contains: A private int data field named id for the...
Fantastic news! We've Found the answer you've been seeking!
Question:
![image](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/01/65b782b2bd7dd_36265b782b293471.jpg)
![image](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/01/65b782b329f8e_36365b782b3106d1.jpg)
Transcribed Image Text:
Create a class named Account that contains: A private int data field named id for the account (default 0). A private double data field named balance for the account (default 0). A private double data field named annualInterestRate that stores the current interest rate (default 0). Assume that all accounts have the same interest rate. A private Date data field named dateCreated that stores the date when the account was created. Create an Account class with a constructor and methods need to support the code in driver program shown below (additional methods are NOT necessary). Make sure your toString() method generates output similar to the sample run, use String.format() to format the output string. Some helpful formulas; Note: annuallnterestRate is a percentage, for example 4.5%. MonthlyInterest Rate is annuallnterestRate / 1200. Monthly interest = balance * MonthlyInterestRate. Source code: public class Account Driver { public static void main (String[] args) { Account account = new Account (1122, 20000); Account.setAnnual InterestRate (4.5); account.withdraw (2500); account.deposit (3000); System.out.println("Balance is " + account.getBalance () ); System.out.println("Monthly interest is " + account.getMonthly Interest ()); System.out.println("This account was created at account.getDate Created()); + } System.out.println(account); } Sample run (no user input). Obviously your sample run will include the current date. Balance is 20500.0 Monthly interest is 76.875 This account was created at Tue May 12 18:43:24 MDT 2020 Account Annual Interest Rate: 4.5% Current Balance : 1122 : $20,500.00 Create a class named Account that contains: A private int data field named id for the account (default 0). A private double data field named balance for the account (default 0). A private double data field named annualInterestRate that stores the current interest rate (default 0). Assume that all accounts have the same interest rate. A private Date data field named dateCreated that stores the date when the account was created. Create an Account class with a constructor and methods need to support the code in driver program shown below (additional methods are NOT necessary). Make sure your toString() method generates output similar to the sample run, use String.format() to format the output string. Some helpful formulas; Note: annuallnterestRate is a percentage, for example 4.5%. MonthlyInterest Rate is annuallnterestRate / 1200. Monthly interest = balance * MonthlyInterestRate. Source code: public class Account Driver { public static void main (String[] args) { Account account = new Account (1122, 20000); Account.setAnnual InterestRate (4.5); account.withdraw (2500); account.deposit (3000); System.out.println("Balance is " + account.getBalance () ); System.out.println("Monthly interest is " + account.getMonthly Interest ()); System.out.println("This account was created at account.getDate Created()); + } System.out.println(account); } Sample run (no user input). Obviously your sample run will include the current date. Balance is 20500.0 Monthly interest is 76.875 This account was created at Tue May 12 18:43:24 MDT 2020 Account Annual Interest Rate: 4.5% Current Balance : 1122 : $20,500.00
Expert Answer:
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
Cash Disbursements Schedule Del Spencer is the owner and founder of Del Spencer's Men's Clothing Store. Del Spencer's has its own house charge accounts and has found from past experience that 10...
-
Suppose that a class named Account has the following specifications: A private int data field named id for the account (default 0). A private double data field named balance for the account...
-
Task: Design a class named Account that contains: A private int data field named id for the account (default 0). A private double data field named balance for the account (default 0). A private...
-
Explain the difference between an error of commission and an error of principle.
-
Show which of the nitrogen atoms in purine are basic, and which one is not basic. For the non-basic nitrogen, explain why its nonbonding electrons are not easily available to become protonated.
-
The following questions concern computer-assisted audit tests. Choose the best answer. a. Which of the following is not a data communications risk? * (1) Viruses that are transmitted by e-mail (2)...
-
Can you explain why the relationship between the various forms of market efficiency explained above should be the case?
-
A major airline manufacturer was found to be in violation of FAA safety rules and was forced to install additional safety devices in each of its planes within six months. The airline company projects...
-
The shipping paid on goods purchased F.O.B. Shipping Point was not recorded. This error will cause: A. net income to be understated. B. total liabilities to be understated. c. total liabilities to be...
-
Context This task requires analysing a network scenario, design the network architecture and recommend IT solutions including ethical, security and sustainability considerations.The purpose of this...
-
Some of the information found on a detailed inventory card for Blue Spruce Stationery Ltd. for May is as follows: Received Issued Balance Unit Date No. of Units No. of No. of Cost Units Units May 1...
-
In addition to the strongest military in the world, the United States wields enormous soft power. Define soft power. What factors make the United States powerful when it comes to soft power?
-
Tampa by the Bay Cardiology practice is experiencing long wait times for new patient appointments. Next available appointment is 30 days. The administrator has asked the practice manager to construct...
-
In 2013, Idalia Hernndez Ramos, a middle school teacher in Mexico, was a victim of cyber harassment. After discovering that one of her students tweeted that the teacher was a "bitch" and a "whore,"...
-
Your life couldn't be any better. You just accepted a new role as a senior consultant for a project management services firm in San Francisco, and the move is finally happening. You've got a great...
-
What are the two "engines" that drive earth's processes, how do they work (basically) and what are their energy sources? How do the "engines" influence and interact with the Earth Systems? (provide a...
-
Assume that: the DAD is given by: y, = y* - (Tt 1*) + , and the DAS is given by: A = Tt-1 + 2(y, - y") + V where y* denotes the potential output, ** is the target inflation and , and , are...
-
The Strahler Stream Order System ranks streams based on the number of tributaries that have merged. It is a top-down system where rivers of the first order are the headwaters (aka outermost...
-
What are the three ways that ratios can be expressed? AppendixLO1
-
What is the purpose of profitability ratios? Explain earnings per share and the price-earnings ratio. AppendixLO1
-
What does a statement of stockholders' equity show? AppendixLO1
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App