Well before looking at the code, I just want to summarize what the following lines of code will do.
Console.WriteLine(); <----- Writes a string of characters on the console in it's own line.
So writing Console.WriteLine("Hello World"); would result in Hello World displaying on your console and have the cursor move to the next line down.
Console.Write("Hello World"); would also display Hello World however the cursor would be next to the word and not the line below.
Console.ReadLine(); <------ This nifty method will allow you to take in user input. Whether the user input is numeric or alphabetic, it will take the input as a string or text. So you cannot use it in any mathematical operations right away. That is if the user was to enter 5 and you want to add 4 to that 5, you could not, right off the bat anyway. However we will go into that later.
Okay, now observer the code below:
using System;
CODE
==================== BEGIN C# CODE =====================================
namespace testProg
{
///<summary>
/// Test Programming
///</summary>
class helloProg
{
[STAThread]
static void Main(string[] args)
{
//Declare a String variable. Name it userName
string userName;
Console.Write("Console Asks - Please Enter your Name: ");
//Place the user input into the variable userName with
//Console.ReadLine()
userName = Console.ReadLine();
//Skip a line for nicer formatting
Console.WriteLine("");
//On the next line, display the input.
//{0} is where the variable value will go. It
//is followed by a comma and variable name userName
Console.WriteLine("Hello {0}!", userName);
Console.WriteLine("Press Enter to Continue");
//The Console.Readline will pause the program until you
//press [ENTER]. Then it will exit.
Console.ReadLine();
} //end main
} //end class
} //end namespace
=========================== END C# CODE ================================
Okay aside from the information I provided before the code, I think the comments explain pretty much what is going on within this program. However, I want to further elaborate how we placed the user input into the variable userName. By setting first we declared userName as a string (i.e. string userName;) Later in the program, we said userName is equal to what the user enters, userName = Console.ReadLine(); This is what did the trick. now we just output user name in one of our Console.WriteLine's and Voila. Modify the variables, add lines and variables and get acquainted with it yourself. I'll be back soon to provide another lesson.
By the way, I hope I am able to upload my attachment. The code on this one looks kinda sloppy. It's in .pdf format.

