Programing Primer!

here is the link back to the main page: Main Page.

Programming Primer Programming Language Output is what is what is displayed on the screen when running a program Properties control objects. They control the colour, text and more Variables are items that are stored in the RAM so that the program can refer to them Input is what the user types into the program How To Create A Program To create a windows forms application: click: file -> new -> project -> windows forms application give the program a name drag and drop a button from the toolbox onto your form double click the button to enter the code editor To create a console program: click: file -> new -> project -> console application give the program a name in the code editor write the following: Console.WriteLine(“name"); Declaring and Initializing Variables boolean(true/false) Boolean blnVar; blnVar = true; integer(-3,-2,-1,0,1,2,3) Int 32 intVar; intVar = -47; Floating Point(double, decimal number) Double dblVar; dblVar = 13.653; String(words) String strVar; strVar = "text"; Getting Input Console Input Console.ReadLine(); Windows Form Input int x; int.TryParse(txtInput.Text, out x); or int x = (int)nudInput.Value; or double x; double.TryParse(txtInput.Text, out x); or double x = (double)nudInput.Value; Math Adding and Subtracting Int32 x = 2; Int32 y = 1; Int32 = adding; adding = x + y; Console.WriteLine(String.Concat(x.ToString(), "+", y.ToString(), "=", adding.ToString())); Int32 subtracting; subtracting = x - y; Console.WriteLine(String.Concat(x.ToString(), "-", y.ToString(), "=", subtracting.ToString())); Console.ReadKey(); Multiplying and Dividing Double x = 5.65; Double y = 7; Double multiplying; multiplying = x * y; Console.WriteLine(String.Concat(x.ToSTring(), "*", y.ToString(), "=", multiplying.ToString())); Double dividing; dividing = x / y; Console.WriteLine(String.Concat(x.ToString(), "/", y.ToString(), "=", dividing.ToString())); Console.ReadKey; Concatenating Strings Concatenating strings connects words by using String.Concat() String strType = "Chicken Noodle"; String strFood = "Soup"; Console.WriteLine(String.Concat(strType, " message", strFood)); How To Create Outpout in your windows form application do the following: drag and drop a label and a button onto your form in the properties rename your label to lblOutput between the braces type the following lblOutput.Text = “message"; start the program and press the button to view the text in your console program write the following: Console Console.WriteLine Console.WriteLine(“message");

To learn more HTML/CSS, check out these tutorials!