Assume the method below has been added to the BankAccount class. public void transfer (BankAccount source, double amount)
{
Balance = balance + amount;
Source.balance = source.balance - amount;
}
What will be output from the following statements that use the revised BankAccount class?
BankAccount first = new BankAccount (100.0) ;
BankAccount second = new BankAccount (300.0) ;
First.transfer (second, 50.0) ;
System.out.println (first.getBalance() + " "
+ second.getBalance() ) ;
A) 100.0 300.0
B) 150.0 250.0
C) 150.0 300.0
D) 100.0 250.0
Correct Answer:
Verified
Q5: Which of the following declares a sideLength
Q77: What is the name of the parameter
Q80: Given the following constructor for the BankAccount
Q80: Which of the following corresponds to the
Q81: What will be output from the following
Q82: Fill in the first line of this
Q83: Consider the constructor of the BankAccount class
Q88: When drawing complex shapes, provide a(n) _
Q89: Consider the following code fragment from the
Q99: Consider the following invocation of the deposit
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents