Archive for January, 2017
Sunday, January 8th, 2017
In addition to If, C# offers conditional statement If-Else. When I explained the If statement, I was saying that the program will execute the instructions only if the If condition is True. What if we wanted to execute a total different condition when and only when that condition is False?… Read more
Tags: conditional processing, if, if else, if else if else
Posted in Introduction | No Comments »
Saturday, January 7th, 2017
As previously stated in our lessons, as your programs will become more and more complex, they will perform a set of instructions when a condition is True, and another one when is False. When your program executes a conditional processing, you will be testing a condition with If.… Read more
Tags: if, if instruction
Posted in Introduction | No Comments »
Saturday, January 7th, 2017
A few lessons so far dealt with conditional processing, displaying a result when a condition is true, and another when it is false. When working with conditional processing, it is important to understand the representation of True and False values in C#.… Read more
Tags: conditional processing, if instruction
Posted in Introduction | No Comments »
Saturday, January 7th, 2017
Now that we are done with data types, we can finally start learning about doing something useful with that data. Conditional processing is one of the most basic forms of allowing your programs to perform an useful action.
As you noticed, all the programs presented so far in our lessons started the execution with the Main method, and continued subsequently with the following instructions.… Read more
Tags: conditional processing
Posted in Introduction | No Comments »
Friday, January 6th, 2017
Explicit type conversion basically means “I know what I am doing, so let me covert this into this, because I know it will work”. It is used whenever there is a possibility of data loss. For instance, when converting from ANY real number type into an integer, there is ALWAYS a loss of data, because integers cannot store fractional parts.… Read more
Tags: casting, explicit type conversion, type conversion
Posted in Introduction | No Comments »
Friday, January 6th, 2017
As we discussed in the last lesson, implicit type conversion (hidden conversion) is only possible when there is no risk of any data loss during the transformation (for instance, when converting a lower range number, like an int, to a higher range number, like a long).… Read more
Tags: casting, Implicit type conversion, type conversion
Posted in Introduction | No Comments »
Friday, January 6th, 2017
Aside of the operators I have enumerated so far, there are a few other operators that are either too simple, too rarely used or too unimportant to create additional posts for them.
The . (dot) operator. We’ve used it quite a lot so far (remember Console.WriteLine?).… Read more
Tags: operators, other operators
Posted in Introduction | No Comments »