Ex1+T2+Question+1

**Fill in the following theory parts:**
· What is a variable, why do we need them, how do we use them and for what? A variable is easy to understand as a "box" where you can keep information. There are different types of it for you to keep text, numbers, boolean, etc. For example: int, char, decimal, float, bool, string, etc. A variable always needs a name for you to use it when you are programming. This is useful for youaqs you do not have to mention that you are using a variable by mentioning only its name. It is as if you always call somebody as " human Rodrigo", you only call him by his name, "Rodrigo". Each variable has to have a value which you will give as you type instructions. This may change as you also change the instructions. Variables can only get the value that they are supposed to have, for example: if you type bool you can only write "true" or "false", you cannot write a number or any other thing.

· What is casting and why is it used? It used to change the variable's type into antoher to keep another type of value. Boolean and char types cannot be changed (casted).

· What is an if statement, for what do we use it and how does it works? An if statement is used as a condition, these condition must be achieved so the program does another thing you want it to do. Let me explain this way. For example: You are in a kindergarden and you call the attention of everyone and say If your name starts with letter C, go with your teacher.

· What is the difference between an If statement and an If/Else statement? When you write an "if" statement it should provide a condition to the variable, hence it should do an action as: show a message box. For example if (a>0){ messagebox.show("bigger than zero"); } if the condition is correct and the user types a number bigger than zero the first message box will appear. An "If/Else" statement will include everything that an "If" does but including the statement"else" after the condition is stated. This statement is used for the computer to do something else if the condition is not met. When this happens the computer will read the "else" and if the condition state it, a second message box will appear. ... Else{ messagebox.show("type another number"); }

Taking the kindergarden example: You call the attention of everyone and say - If your name starts with letter C, go with your teacher, Else (If your name doesn't starts with "c") stay in your line. Else statement do not always need an instruction after it (ONLY if your name starts with "C" go with your teacher, else it is understanded that if your name starts with any other letter you do not have to go with your teacher). However, sometimes an instruction is useful after "else" (...else (if your name starts with "e" go to your classroom)).

· How do we use a MessageBox We use a message box as a window which can tell information to the user. It has almost any use, for example, to tell him if about the information he is entering, if it is correct or if it isn't. It is able for the programmer to state what the messageBox will say, for example:

MessageBox.Show (" the information you want to give is incorrect. ");

· What are the operators, which operators can we use and for what? Operators are signs used in general to state the instructions while programming. These are signs we commonly use to get the result of a subtraction (-), addition (+), multiplication (x), division (/), greater than (>), smaller than (<), or to have as a result the leftover from a division (%). These may be combined to perform different things. ++ will add one to a number. (5++= 6) -- will subtract one to a number. (5--=4) <= will tell you if a number is smaller or equal to another. (This will be a boolean result) (5<=6= True) >= will tell you if a number is greater or equal to another. (This will be a boolean result) (5>=6= False)