Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Tutorial1
- {
- class Program
- {
- static void Main(string[] args)
- {
- string favoritecolor;
- Console.WriteLine("What if your favorite color?");
- //Incase you were wondering the next statement is reading whatever
- //is typed and assigning it to favoritecolor when enter is pressed
- favoritecolor = Console.ReadLine();
- //Just so you know I always type my cases and breaks prior to typing code.
- //It just seems easier to me. Do whatever you like though
- switch (favoritecolor)
- {
- case "blue":
- case "Blue":
- Console.WriteLine("Your favorite color is blue");
- break;
- case "Red":
- case "red":
- Console.WriteLine("Your favorite color is red");
- break;
- case "purple":
- case "Purple":
- Console.WriteLine("Your favorite color is purple");
- break;
- case "1":
- Console.WriteLine("You were supposed to pick a color");
- break;
- default:
- Console.WriteLine("Your favorite color isn't on my list.");
- break;
- }
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment