NedyalkoKikov

MethodsWithIFStatements

May 5th, 2016
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 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 MethodsWithCases
  8. {
  9. class MethodsWithIFStatements
  10. {
  11. static void Main()
  12. {
  13. string text = Console.ReadLine().ToLower();
  14. PrintSpicies(text);
  15. }
  16. public static void PrintSpicies(string text)
  17. {
  18. if (text == "cat" || text == "dog")
  19. {
  20. Console.WriteLine("mammal");
  21. }
  22. else if(text == "snake" || text == "iguana" || text == "hameleon")
  23. {
  24. Console.WriteLine("Reptile");
  25. }
  26. else
  27. {
  28. Console.WriteLine("Unknown");
  29. }
  30.  
  31. }
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment