if (condition) { ... } else if (other) { ... } else { ... } runs the first branch whose condition is true, so put the narrowest test first. Combine conditions with && (and), || (or) and ! (not). && binds tighter than ||, so add parentheses when you mix them.
A switch expression turns a value into another value in one place:
decimal rate = bikeType switch { "city" => 6m, "electric" => 12m, _ => throw new ArgumentException("Unknown bike") };
Each arm is a pattern. Constant patterns match a value, relational patterns compare (< 13 => "child"), and _ is the catch-all. The compiler warns when a switch expression might not match every input. Arms are tried from the top, so order them from narrowest to widest.
Relational patterns, tried from the top. The first arm that matches wins.