Escolar Documentos
Profissional Documentos
Cultura Documentos
A variable is simply a named location in which a value is held whilst the program runs
In the case of C# you can lump statements together to form a lump of program which does one particular task. Such
a lump is called a method.
The names that you invent to identify things are called identifiers
The words which are part of the C# language itself are called keywords
Objects that are part of the framework we are using (eg. Console. ) ( Object.Method(parameters) )
A class is a container which holds data and program code to do a particular job. A C# program is made up of one or
more classes.
Give the type of the data, followed by a list of the names you want the variables to have
Storing Numbers
“Real” are numbers that’s not integers. A float literal is a real number with an f after it and double literal dosent.
Storing Text
Declaring variables
Usage of identifiers:
double X = double.parse(XString);
Casting
However, through the use of casting, “narrowing” can be done [With the use of brackets]
This is to ‘tell’ the complier that you are aware of the potential loss of info by narrowing, and thus it will compile
BAD PRACTICE: Eg. int X ; (int) X = 1.999 ; will result in X printing a value of 1 and ignoring whatever rounding.