The rules for this code:

  1. There are two categories for competition: 18+ and U-18s.
  2. 18+ race at 9.30 am / 11 am, while U-18s race at 12.30 pm.
  3. 18+ runners who report before 9.30 are considered early.
  4. Runners who are exactly 18 should be included in 18+, but was not considered in this code.

The code is as follows:

const runnerEarly = true; // Change as fit.

const runnerAge = 19; // Change as fit.

runnerAge > 18 ? (raceNumber += 1000) : raceNumber;

if ((runnerAge > 18 && runnerEarly)) {
  console.log(
    `Hello! Your number is ${raceNumber} and you will compete at 9.30 am.`
  );
} else if ((runnerAge > 18 && !runnerEarly)) {
  console.log(
    `Hello! You will race at 11 am, and your race number is ${raceNumber}.`
  );
} else if ((runnerAge < 18)) {
  console.log(
    `Hello, you will race at 12.30pm.`
  );
} else {
  console.log(
    "Please proceed to the registration desk.";
  ); // This condition is for runners who are exactly 18 yo. We did not consider them to be part of 18+.
}

This was part of the Codecademy JS course.