Skip to main content
๐Ÿ“œ WAYPOINT LESSON

Checkpoint โ€” Methods

โญ beginnerโณ 20 min read๐Ÿ“ Lesson 21 of 85

Dispatch, contracts, and counting โ€” two methods, both tested on their edges.

Checkpoint: the operator console

Task: implement two methods:

  1. static double Apply(char op, double a, double b) โ€” +, -, * behave as usual; / divides but throws DivideByZeroException when b is exactly 0 (remember: doubles don't throw on their own โ€” 1.0 / 0.0 is Infinity, so you must check); any other character throws ArgumentException.
  2. static int CountVowels(string s) โ€” count of vowels aeiou, case-insensitive; null or empty input counts 0.