Assume that a FixedTermSavingsAccount object named
FTSA1 has been declared and instantiated.
1. What parameter did the constructor need? A String representing the user’s
name
2. What is the balance set to? 0.0
3. If the getBalance method is called, exactly
what is returned? (i.e. what
would be printed?) 0.0 (a Double)
4. If the getAccountID() method is called,
exactly what is returned? FT-0000000000
5. If the getBalanceMessage () message is
called, precisely what is returned? Balance: $0.00
6. What is the significance of the access modifier
protected? (i.e. when you declare
something protected, what happens or doesn’t happen?) It limits access to an object of the class and its children.
7. Who always has access to private and
protected methods and variables of a class?
Object of the class itself
8. If I declare and instantiated another
FixedTermSavingsAccount object named FTSA2,
what will be returned by FTSA2.getAccountID() FT-0000000001
9. What will be returned by the following
– FTSA1.compareTo(FTSA2) -1
10. What will be returned by the following –
FTSA1..compareTo(FTSA1) 0
11. What will be returned by
FTSA1.deposit(-324.00) Deposits should be positive
12. What will be returned by FTSA2.deposit
(150.) Deposited $150.00
13. Now what will be returned by
FTSA1.getBalance() 0.0
14. Now what will be returned by
FTSA2.getBalanceMessage() Balance: $150.00
15. Is there any method in
FixedTermSavingsAccount that has not been tested in these 14 questions? YES
16. If your answer to 15 was yes, what hasn’t been tested? getUserName
Suppose a SavingsAccount object named SA is created.
1. What is returned by SA.getAccountID() SA-0000000002
2. Was
any method in FixedTermSavingsAccount’s methods altered? NO
3. Were
any methods added to FixedTermSavingsAccount class?Nothing
was added to FixedTermSavingsAccount class but a method not present int
FixedTermSavingsAccount class was added to its child
4. What
is the result of the following method call FTSA1.compareTo(SA)-1
5. What
is returned by SA.getBalance()?0.0
6. What
is returned by SA.deposit (57.)Deposited $57.00
7. What
is returned by SA.withdraw (72.) 72 could not be
withdrawn {because there is only 57 in the account }
8. What
is returned by SA.withdraw (35) $35.00 was successfully withdrawn . The
balance in the account is $22.
9. What
is returned by SA.deposit (115.)Deposited $115.00 since the
method doesn’t return the new balance, you should immediately check the balance
10.
What is returned by SA.getBalanceMethod?
___________________________________________________