Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 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 PetsNumbers
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. int petNo = 0;
  15. Console.WriteLine("How many pets do you have?");
  16. string input = Console.ReadLine();
  17. switch (input.ToLower())
  18. {
  19.  
  20. case "0":
  21. Console.WriteLine("Maybe you will get some pets someday soon!");
  22. break;
  23. case "1":
  24. Console.WriteLine("Say hello to your special friend from Nick!");
  25. break;
  26. case "2":
  27. Console.WriteLine("Two is a nice number of pets!");
  28. break;
  29. case "3":
  30. Console.WriteLine("You must really like pets!");
  31. break;
  32. case "4":
  33. Console.WriteLine("Four is a lot of pets!");
  34. break;
  35. default:
  36. if (petNo < 0)
  37. Console.WriteLine("That's not a valid number of pets!");
  38. else
  39. Console.WriteLine("You have so many pets!");
  40. break;
  41.  
  42.  
  43.  
  44.  
  45. }
  46.  
  47.  
  48. Console.ReadLine();
  49.  
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement