Stromeczik

Play

Oct 3rd, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.08 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.     class Play
  10.     {
  11.         public void CanPlay(string outlook, string temp, string huminity, string windy)
  12.         {
  13.             string play = "yes";
  14.  
  15.             if (outlook == "overcast")
  16.             {
  17.                 play = "yes";
  18.             }
  19.  
  20.             if (outlook == "sunny" && huminity == "high")
  21.             {
  22.                 play = "no";
  23.             }
  24.             else if (outlook == "sunny" && huminity == "normal")
  25.             {
  26.                 play = "yes";
  27.             }
  28.  
  29.             if (outlook == "rainy" && windy == "FALSE")
  30.             {
  31.                 play = "yes";
  32.             }
  33.             else if (outlook == "rainy" && windy == "TRUE")
  34.             {
  35.                 play = "yes";
  36.             }
  37.  
  38.             Console.WriteLine("Outlook: " + outlook + ", Temperature: " + temp + " Huminity: " + huminity + " Windy: " + windy);
  39.             Console.WriteLine("Play? " + play);
  40.         }
  41.     }
  42. }
Add Comment
Please, Sign In to add comment