Created
September 18, 2012 19:11
-
-
Save jpetto/3745157 to your computer and use it in GitHub Desktop.
MJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace ConsoleApplicationQuiz1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// ask the user what number jordan wore | |
Console.WriteLine("So, what number did MJ wear?"); | |
// get input from the user | |
// declare a variable to hold user input | |
string strAnswer; | |
// retrieve input from console | |
strAnswer = Console.ReadLine(); | |
// convert user string input to an integer | |
int intAnswer = int.Parse(strAnswer); | |
// branching statement to respond to the user's answer | |
if ((intAnswer == 23) || (intAnswer == 45)) | |
{ | |
Console.WriteLine("Damn right!"); | |
} | |
else | |
{ | |
Console.WriteLine("Move away from Chicago immediately."); | |
} | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment