* Constructor for objects of class SimpleBankAccount public SimpleBankAccount (){ balance- 0.0; ac countid- ""; * Constructor for objects of cla SimpleBankAccount public SimpleBankAccount( double bal, string id ){ balance- bal; accountid - id; * Add money to the balance * @param amount the amount to deposit * Oreturn void public void deposit( double amount )( balance + amount; * Remove money from the balance * Oparam amount the amount to withdraw * @return true (success) or false (failure) public boolean withdraw( double amount ){ if( balance - amount > 0 ){ balance - amount; return true; Jelse{ return false: * Get the balance * Oreturn the balance public double getalance()( return balance; * Set account ID * @param the account ID public void setaccountId(String id){ accountId - id; * Get the account ID * Oreturn she account ID public String getAccountId()( return accountid; * Produces a string represenation of the balance * ereturn The balance (vith a label) public String tostring( )( // display balance as eurrency string balancestr = NumberFormat.getcurrencyInstance(). format( balance ); return "Balance for account + accountId + ": " + balancestr + "\n"; Include at least two classes: CheckingAccount and SavingsAccount. Save your CheckingAccount class in a file named CheckingAccount.java and your SavingsAccount class in a file named SavingsAccount.java. Your CheckingAccount class needs to add a field to track the last processed check number. Also include both a no-argument constructor and a parameterized constructor (that takes a double and a String). Furthermore, include the following method: public boolean processcheck( int checkNum, double amount ); which returns false if checkllum has the same check number as the last check processed, otherwise it reduces the balance by amount and returns true. Your SavingsAccount class needs to have a field for the interest rate. Also include both a constructor that just takes the interest rate (as a double) and a parameterized constructor (that takes a double, String and a double). Furthermore, include an applyInterest () method that multiples the current balance by the interest rate, and adds that to the balance. The following code should work and produce the output below: * Exercises the basic functionality of a Checking and SavingsAccount * Gauthor Hyrum D. Carroll * eversion 0.3 (10/12/2020) public clasas AccountsDriver( public static final double INTEREST_RATE - 0.01; // 14 public statie void main( String(] args ){ CheckingAccount checking - new Checkingaccount( 100.0, "checking123" ); SavingsAccount savings = new Saving SAccount( 1000.0, "savingsi24", INTEREST_RATE ); double monthlyExpenses - 756.34; int electricBillcheckNum = 2123; do uble electricsill = 60.34; int registationCheckNum- 21243; do uble registration = 50.00; double dinnerMoney- 55.32; double futurecar - 200.0; do uble textbook = 90.0; // checking account transactions checking.deposit( monthlyExpenses ); checking.processcheck( electriceillcheckNum, electriceil1 ); checking.withdraw( dinnerMoney ); checking.processcheck( registationCheckNum, registration ); System.out.print( checking.tostring () ); System.out.printin( ); // savinga account transactions savings.deposit( futurecar ); savings.applyInterest( ); savings.withdraw( textbook ); System.out.print( savings.tostring() ); System.out.println( ); Output: Checking Account: Balance for account checking123: $690.68 Last processed check number: 2124 Savings ACcount: Balance for account savings124: $1,122.00 APR: 1.e% Make just the necessary changes to the code in SimpleBankAccount to complete the instructions. Submit the following files: • CheckingAcount.java
* Constructor for objects of class SimpleBankAccount public SimpleBankAccount (){ balance- 0.0; ac countid- ""; * Constructor for objects of cla SimpleBankAccount public SimpleBankAccount( double bal, string id ){ balance- bal; accountid - id; * Add money to the balance * @param amount the amount to deposit * Oreturn void public void deposit( double amount )( balance + amount; * Remove money from the balance * Oparam amount the amount to withdraw * @return true (success) or false (failure) public boolean withdraw( double amount ){ if( balance - amount > 0 ){ balance - amount; return true; Jelse{ return false: * Get the balance * Oreturn the balance public double getalance()( return balance; * Set account ID * @param the account ID public void setaccountId(String id){ accountId - id; * Get the account ID * Oreturn she account ID public String getAccountId()( return accountid; * Produces a string represenation of the balance * ereturn The balance (vith a label) public String tostring( )( // display balance as eurrency string balancestr = NumberFormat.getcurrencyInstance(). format( balance ); return "Balance for account + accountId + ": " + balancestr + "\n"; Include at least two classes: CheckingAccount and SavingsAccount. Save your CheckingAccount class in a file named CheckingAccount.java and your SavingsAccount class in a file named SavingsAccount.java. Your CheckingAccount class needs to add a field to track the last processed check number. Also include both a no-argument constructor and a parameterized constructor (that takes a double and a String). Furthermore, include the following method: public boolean processcheck( int checkNum, double amount ); which returns false if checkllum has the same check number as the last check processed, otherwise it reduces the balance by amount and returns true. Your SavingsAccount class needs to have a field for the interest rate. Also include both a constructor that just takes the interest rate (as a double) and a parameterized constructor (that takes a double, String and a double). Furthermore, include an applyInterest () method that multiples the current balance by the interest rate, and adds that to the balance. The following code should work and produce the output below: * Exercises the basic functionality of a Checking and SavingsAccount * Gauthor Hyrum D. Carroll * eversion 0.3 (10/12/2020) public clasas AccountsDriver( public static final double INTEREST_RATE - 0.01; // 14 public statie void main( String(] args ){ CheckingAccount checking - new Checkingaccount( 100.0, "checking123" ); SavingsAccount savings = new Saving SAccount( 1000.0, "savingsi24", INTEREST_RATE ); double monthlyExpenses - 756.34; int electricBillcheckNum = 2123; do uble electricsill = 60.34; int registationCheckNum- 21243; do uble registration = 50.00; double dinnerMoney- 55.32; double futurecar - 200.0; do uble textbook = 90.0; // checking account transactions checking.deposit( monthlyExpenses ); checking.processcheck( electriceillcheckNum, electriceil1 ); checking.withdraw( dinnerMoney ); checking.processcheck( registationCheckNum, registration ); System.out.print( checking.tostring () ); System.out.printin( ); // savinga account transactions savings.deposit( futurecar ); savings.applyInterest( ); savings.withdraw( textbook ); System.out.print( savings.tostring() ); System.out.println( ); Output: Checking Account: Balance for account checking123: $690.68 Last processed check number: 2124 Savings ACcount: Balance for account savings124: $1,122.00 APR: 1.e% Make just the necessary changes to the code in SimpleBankAccount to complete the instructions. Submit the following files: • CheckingAcount.java
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Topic Video
Question
For Java:
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education