Which three lines, when inserted independently at line n1, cause the program to print a o balance?

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?

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);



Leave a Reply 11

Your email address will not be published. Required fields are marked *


IO

IO

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

JoJo

JoJo

this is correct answer!

smith

smith

d,g,h is the correct answer

TC

TC

D, G, H is the right answer

Javier Miranda

Javier Miranda

Estoy loco o no hay H en las opciones de respuesta

Fredy Benavides

Fredy Benavides

jajaja I was looking the answers by several minutes trying to find the third option

A,E and missing one

xxx

xxx

a,e,g

Test

Test

Can you please explain why g??

JoJo

JoJo

answer: A,E, and missing one
testking missing an option.

appsstuff

appsstuff

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