Guest User

Untitled

a guest
Sep 26th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.47 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Tutorial1
  5. {
  6. class Program
  7. {
  8. static void Main(string[] args)
  9. {
  10. string favoritecolor;
  11. Console.WriteLine("What if your favorite color?");
  12. //Incase you were wondering the next statement is reading whatever
  13. //is typed and assigning it to favoritecolor when enter is pressed
  14. favoritecolor = Console.ReadLine();
  15. //Just so you know I always type my cases and breaks prior to typing code.
  16. //It just seems easier to me. Do whatever you like though
  17. switch (favoritecolor)
  18. {
  19. case "blue":
  20. case "Blue":
  21. Console.WriteLine("Your favorite color is blue");
  22. break;
  23. case "Red":
  24. case "red":
  25. Console.WriteLine("Your favorite color is red");
  26. break;
  27. case "purple":
  28. case "Purple":
  29. Console.WriteLine("Your favorite color is purple");
  30. break;
  31. case "1":
  32. Console.WriteLine("You were supposed to pick a color");
  33. break;
  34. default:
  35. Console.WriteLine("Your favorite color isn't on my list.");
  36. break;
  37. }
  38. Console.ReadLine();
  39. }
  40. }
  41. }
Add Comment
Please, Sign In to add comment