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:
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.
-
The polarization of a carbonyl group can be represented by a pair of resonance structures: Cyclopropenone and cycloheptatrienone are more stable than anticipated. Cyclopentadienone, however, is...
-
According to the survey mentioned in the case, nearly 70 percent of the respondents claim a willingness to try dishes cooked by robot chefs. You wish to estimate with 95% confidence (Z=1.96) that the...
-
Define flowcharting.
-
Gant Company purchased 20 percent of the outstanding shares of Temp Company for $70,000 on January 1, 20X6. The following results are reported for Temp Company: Required Determine the amounts...
-
Description The project will be developing a real-world case of topic covered throughout the course. The real-world example can originate from your (1) workplace (2) current or historical events, or...
-
Use the following forward and spot prices for Canadian dollars (C$) to answer the question below. The prices are in U.S. dollars ($/C$). Forward rate for 4/15/20 Spot rate delivery of Canadian...
-
How do I write code to combine two singly linked lists without duplication in c++? The linked lists don't need to be sorted in any order. They just need to not have duplicates. combine(const...
-
A Project Manager (PM) wants to price out the cost for her project for the use of a piece of equipment. The company she works for uses 4.000 work weeks per month for their cost calculations and knows...
-
If you have a 65 amp current and two cables are 9 cm apart how strong is the magnetic field. compare to earths magnetic field =5*10^-5
-
TBGNXY243 Corporation's capacity is 1,000 units. The results for the first year of TBGNXY243 operations are based on 1,000 units of a single product made and sold and can be found below. Direct...
-
Think about the Martha Rinaldi case in this context for instance. Look at the role of Martha's boss, Natalie Follett. We can see that Natalie was resisting the organizational change that Martha was...
-
Write a C + + pogram in which: The user enters 5 integers which are saved in a file. After that, the numbers are read from the text book and divided into simple factors, which are then printed on the...
-
Chandler and Cassidy are married and file a joint return. Chandler is age 66, and Cassidy is age 68. They report the following income items: Dividend eligible for ex preferential rate Capital gain...
-
One study found that the elderly who do not have children dissave at about the same rate as the elderly who do have children. What might this finding imply about the reason the elderly do not dissave...
-
We studied duality only in the context of standard maximum and minimum problems. The concept can be extended to arbitrary problems using the following correspondences: Notice that the first four...
-
Referring to Exercise 14 (a) Write the general form of the dual of the problem: (c) For each of the problems in (a) and (b), show that the dual of the dual problem is the original (i.e., primal)...
-
Our proof of the Strong Duality Theorem, as well as the presentation of the tableau method in Section 3, depended on the fact that the dictionary and tableau methods were equivalent. More...
Study smarter with the SolutionInn App