HomeChallengesRepsProblemsLeaderboardTake a challenge

Copy or reference?

“As a parent, I can top up my child’s school wallet.” Before any wallet logic gets written, you need to know what an assignment copies. Predict the seven numbers this prints, without running it.

Beginner10 min on the clock5 graded checks · 100 pointsFrom Procedures to Objects
Graded by reading your code against the checklist below.

What you build

  • Read Puzzle.cs without changing it
  • Fill Expected with the seven numbers it prints, in order

Done means

All seven predicted values match what the program prints.

How it is graded

Published in full, before you start — every point is one of these and there is nothing else.

  1. Lines 1–2: assigning a struct copies it+20Copy or reference
  2. Line 3: two names, one wallet+20Copy or reference
  3. Line 4: a struct parameter is a copy+20Copy or reference
  4. Line 5: a reference parameter reaches the object+20Copy or reference
  5. Lines 6–7: reassigning a parameter changes only the parameter+20Copy or reference

What it teaches

The rest of From Procedures to Objects