Given the following class: And given the following main method, located in another class:
Which three lines, when inserted independently at line n1, cause the program to print a o
balance?
A.
acct.changeAmount(-acct.amount);
B.
this.amount = 0;
C.
amount = 0;
D.
acct (0) ;
E.
acct.amount = 0;
F.
acct. getAmount () = 0;
G.
acct.changeAmount(0);
A E
Which three lines, when inserted independently at line n1, cause the program to print a o balance?
A. this.amount = 0;
B. amount = 0;
C. acct (0) ;
D. acct.amount = 0;
E. acct. getAmount () = 0;
F. acct.changeAmount(0);
G. acct.changeAmount(-acct.amount);
H. acct.changeAmount(-acct.getAmount());
Answer: D,G,H
this is correct answer!
d,g,h is the correct answer
D, G, H is the right answer
Estoy loco o no hay H en las opciones de respuesta
jajaja I was looking the answers by several minutes trying to find the third option
A,E and missing one
a,e,g
Can you please explain why g??
answer: A,E, and missing one
testking missing an option.
A- acct.changeAmount(-acct.amount); this will reverce the value
B- this.amount = 0; — in the same class
E- acct.amount = 0; — chane in object itself