Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace GuessingGame
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {   //Intro
  13.             Console.WriteLine("Hello! Welcome to the guessing game!");
  14.             Console.WriteLine("Push any key to continue.");
  15.             Console.ReadKey();
  16.             Console.WriteLine("You will be asked a question and presented with three options.");
  17.             Console.WriteLine("Type the correct one's letter and you get a point!");
  18.             Console.WriteLine("Push any key to continue.");
  19.             Console.ReadKey();
  20.  
  21.             //Question 1
  22.             Console.WriteLine("Question 1:");
  23.             Console.WriteLine("Who is the current president?");
  24.             Console.WriteLine("A)Obama  B)Jesus  C)Ashton Kutcher");
  25.  
  26.             //Define Variables
  27.             int points = 0;
  28.  
  29.             //Question 1 Code
  30.             switch(Console.ReadKey())
  31.             {
  32.                 case ConsoleKey.A:
  33.                     Console.WriteLine("Correct!");
  34.                     points++;
  35.                     Console.WriteLine("You have " + points + " point!");
  36.                     Console.ReadKey();
  37.                             break;
  38.  
  39.                 default:
  40.                             Console.WriteLine("Incorrect. You disgrace.");
  41.                             Console.ReadKey();
  42.                             break;
  43.  
  44.             }
  45.             Console.WriteLine("Question 2");
  46.             Console.WriteLine("What is your favorite food?");
  47.             Console.WriteLine("A)Pizza  B)Curry  C)Waffles");
  48.            
  49.             //Question 2 Code
  50.             switch(Console.ReadKey())
  51.             {
  52.                 case ConsoleKey.B:
  53.                     Console.WriteLine("Correct!");
  54.                     points++;
  55.                     Console.WriteLine("You have " + points + " points!");
  56.                     Console.ReadKey();
  57.                     break;
  58.  
  59.                 default:
  60.                     Console.WriteLine("You serious? This should be easy.");
  61.                     Console.ReadKey();
  62.                     break;
  63.             }
  64.            
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement