HomeChallengesRepsProblemsLeaderboardTake a challenge

The override that never ran

The Julian calendar compiles, runs and gives Gregorian answers. GetSchoolBirthday lives in the base class, and its call to IsLeap was fixed to the base version when it compiled. Make the object decide.

Intermediate15 min on the clock5 graded checks · 100 pointsObjects That VaryPro
Graded by reading your code against the checklist below.

What you build

  • Mark the base IsLeap virtual
  • Mark the Julian IsLeap override
  • Clear the CS0108 warning without using new
  • Work out the Julian answers, including the control case

Done means

Same method name, same base-typed variable, and the answer depends on the object.

How it is graded

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

  1. The base IsLeap is virtual+20Which method actually runs
  2. The Julian IsLeap overrides, it does not hide+25Which method actually runs
  3. Base code still asks IsLeap+10Which method actually runs
  4. The Julian answers are traced correctly+30Which method actually runs
  5. The control case does not move+15Which method actually runs

What it teaches

The rest of Objects That Vary