rado84

AnimalType

Jun 9th, 2016
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 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 AnimalType
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string animal = (Console.ReadLine());
  14.  
  15. switch (animal)
  16. {
  17. case 1:
  18. animal = "dog";
  19. Console.WriteLine("mammal");
  20. break;
  21.  
  22. case 2:
  23. animal = "crocodile";
  24. Console.WriteLine("reptile");
  25. break;
  26.  
  27. case 3:
  28. animal = "tortoise";
  29. Console.WriteLine("reptile");
  30. break;
  31.  
  32. case 4:
  33. animal = "snake";
  34. Console.WriteLine("reptile");
  35. break;
  36. }
  37.  
  38. if (animal != "dog" && animal != "crocodile" && animal != "tortoise" && animal != "snake")
  39. { Console.WriteLine("unknown"); }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment