Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

9.4.7 I'm not sure how to start. Please answer all parts using the given format. Thank you! 9.4.7 photo retake + TE Exercise 9.4.7: Bank

9.4.7 I'm not sure how to start. Please answer all parts using the given format. Thank you!
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
9.4.7 photo retake
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
+ TE Exercise 9.4.7: Bank Accounts as Let's Go For this exercise, you will be completing the Account class, which simulates a regular bank account then using overrides and calls to the superclass Create a studentecount. Student accounts differ from regular accounts in that they get a bonus $1 for every deposit but a $2 fee for every withdrawal. You wil override the methods in the Student count by calling the superclass methods with the additonal amount or fee incorporated since the balance is not directly stored in the studentunt object You will also update the touring, as outlined in the comments When completed, create one student account and one regular account for testing. Deposit and withdraw money and print the results. MacBook Pro $ 2 2 3 5 6 7 8 9 0 Q W E R T Y U S D F G I J K N > C V B N M 98 command command optic Status: Not Submitted 9.4.7: Bank Accounts Save Submit Conti D III FILES 1 public class BankTester 2. { 3 public static void main(String[] args) 4- { 5 W Start here! 6 } 7 BankTester Student Account Account.java 31 MacBook Pro 20 % 2 # 3 $ 4 5 co 7 8 W E E 20 T Y . S D F sk G H Status: Not Submitted 9.4.7: Bank Accounts See Gom !!! FILES 1 public class StudentAccount extends Account 2.1 3 W Complete this class with Override methods. 4 5 public Student Account(String studentName, double openingsalt 6 7 1 8 9 W/ Students get a 31 bonus on depositing 10 D BankTestejava Student Accounts D Account W/ Students pay a $2 fee for withdrawing 12 13 14 15 16 17 18 19 ) 20 // toString should read: Student account with a balance of 31 100 MacBook Pro a 7 2 S 4 3 & 7 5 co 8 Q W E R T Y U . S D F G ck H Status: Not Submitted 9.4.7: Bank Accounts Save Sub Canton III 1 public class Account 2.1 FILES private String none; private double balance; // Initialize values in constructor public Account(String clientName, double openingkat DBank Tester java StudeAccount Account 1 1/ Complete the accessor method public double getBalance! } 3 4 5 6 7- 8 9 20 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 22 28 29 30 31 // Add amount to balance public void deposit(double onount) } W Subtract amount from balance public void withdrawal (double amount) ) // Should read: Regular account with a balance of public String toStringo MacBook Pro 2 3 $ 4 5 & 7 6 8 Q W E R T Y U . S D F G . My Section Practice 0 Resume Resume ED Exercise 9.4.7: Bank Accounts points Let's Go! For this exercise, you will be completing the Account class, which simulates a regular bank account, then using overrides and calls to the superclass to create a Student Account. Student accounts differ from regular accounts in that they get a bonus $1 for every deposit, but a $2 fee for every withdrawal. You will override the methods in the Student Account by calling the superclass methods with the additonal amount or fee incorporated since the balance is not directly stored in the StudentAccount object You will also update the toString, as outlined in the comments. When completed, create one student account and one regular account for testing. Deposit and withdraw money and print the results. OL C codehs.com/student/2087860/section/148661/assignment/5896338/ Sandbox My Section Practice Resume Status: Not Submitted 9.4.7: Bank Accounts Save Submit Continue RUN CODE TEST CASES III Bun Code Check FILES 1 public class Bank Tester 2.1 3 public static void main(String[] args) { 5 // Start here! 6 } 7 } D StudentAccount.java Banklater.java Account Java 9 31 A OP HULU Status: Not Submitted RUN CODE TEST CASE 0 III Check Code FILES Studentagapunta Bankester Account 9.4.7: Bank Accounts Sove Continue 1 public class StudentAccount extends Account 2.1 3 // Complete this class with Override methods. -4 5 public Student Account(String studentName, double openingkat 6 7 } 8 9 w Students get a $1 bonus on depositing 10 11 12 13 // Students pay a $2 fee for withdrawing 14 15 16 17 I toString() should read: Student account with a balance of $__ 18 19 ) 20 thes QU 31 Resu Status: Not Submitted RUN CODE TEST CA 2 0 Run Code FILES 4 StudentAccount.java D BankTester.java Account.java 9.4.7: Bank Accounts Submit Continue 1 public class Account 2.{ 3 private String name; private double balance; 5 6 // Initialize values in constructor 7 public Account(String clientName, double openingBal) { 8 9 } 10 11 // Complete the accessor method 12 public double getBalance ! 13 14 15 } 16 17 // Add amount to balance 18 public void deposit(double amount) { 19 20 21 } 22 23 // Subtract amount from balance 24 - public void withdrawal (double amount) { 25 26 27 } 28 29 // Should read: Regular account with a balance of 5._-- 30 public String toStringO{ 31 6 7 Inheritance QU 31 Sandbox My Section Practice Resume Status: Not Submitted 9.4.7: Bank Accounts Save Submit Continue RUN CODE TEST CASES // Initialize values in constructor public Account(String clientName, double openingkat) Bun Cooe Check FILES } StudentAccount.java D BankTester java D Account java 5 6 7. 8 9 10 11 12 - 13 14 15 16 17 // Complete the accessor method public double getBalanceO{ } 18 - / Add amount to balance public void deposit(double amount) { } // Subtract amount fromybalance public void withdrawal (double amount) 19 20 21 22 23 24- 25 26 27 28 29 38 - 31 32 33 34 } 35 } // Should read: Regular account with a balance of $_2 public String toStringo! } O 31 OL

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions