Level 2 - Selections 0 of 9 activities solved
  1. Ride height Not yet solved
  2. Largest number Not yet solved
  3. Seasons Not yet solved
  4. States of water Not yet solved
  5. HTTP status codes Not yet solved
  6. Currency converter Not yet solved
  7. Nitrate Not yet solved
  8. Exam grade Not yet solved
  9. Periodic table Not yet solved
Next series Level 3 - Condition controlled repetitions
Level 2 - Selections

Seasons

Sign in to hand in your solution and get feedback.

// Seasons program using System; class Submission { // ------------------------- // Subprograms // ------------------------- static string seasons(string month) { switch (month) { case "December": case "January": case "February": return "Winter"; case "March": case "April": case "May": return "Spring"; case "June": case "July": case "August": return "Summer"; case "September": case "October": case "November": return "Autumn"; default: return "Error"; } } // ------------------------- // Main program // ------------------------- public static void Main(string[] args) { Console.WriteLine("Enter the month:"); string month = Console.ReadLine(); string season = seasons(month); Console.WriteLine($"Month {month} is in the {season}"); } }