Question: 5 . Write the statement that tests the withdraw method for backAcct 1 6 . What will be output of the statement System.out.println ( bankAcct

5. Write the statement that tests the withdraw method for backAcct1
6. What will be output of the statement System.out.println(bankAcct1.getBalance()); ?
7.What will be output of the statement System.out.println(bankAcct2.getBalance()); ?
8. What will happen if I have a statement : bankAcct2.setBalance(50); in the code above ?
9. Suppose you wanted to obtain the amount to be deposited from the user instead of hardcoding the amount in : bankAcct1.deposit(100.00);
What statement(S) would you add to your code to obtain the value of 100.00 from the user ? Assume your code already has : import java.util.Scanner;
10. Suppose you wanted to obtain the beginning balance in the full-arg constructor from the user, instead of hardcoding the amount in : BankAccount bankAcct2= new BankAccount(500.00);
What statement(S) would you add to your code to obtain the value of 100.00 from the user ? Assume your code already has : import java.util.Scanner;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!