1

if(rand.Next(2) == 0)
forecastSun();
else
forecastRain();

Comments
  • 1
    They may be both correct. Heat+Rain is possible. Best is to check the MET Office.
  • 0
    Looks they are equally likely. 50% rain probability just means that you will belong to the 50% of people who get poured, that's Murphy's Law.
  • 0
    I don't mean to be that guy... But that could probably be refactored to forecast('rain') and forecast('sun')
  • 0
    Let's avoid magic strings too. 😀

    forecast(WeatherType.Rain, 29);
  • 0
Add Comment