+ 1
Anyone knows? I don't get the right code
David and Alex each have aquariums. There are 8 Rainbowfishes in David’s aquarium, and 11 Angelfishes in Alex’s aquarium. Help them exchange their fishes between them. Complete the code to swap the values of variables between aquariumDavid and aquariumAlex.
4 Antworten
+ 5
Christian Joseph Marigmen
If you have ever written code on swaping 2 values then you can solve it. You just have to swap values.
+ 2
Christian Joseph Marigmen
Think of this as a real life problem.
You want to swap fish without any chance of those fish getting mixed up.
Best option, get a 3rd tank
David puts fish in 3rd tank
Alex puts fish in David's tank
3rd tank puts fish in Alex's tank
Now David has Alex's fish
& Alex has David's fish
+ 1
Thank you ☺️