Keywords Flashcards
Local Variable
A variable that is created when the class is first called.
Static Variable
A variable that has had a memory location allocated for the entire lifetime of the run of the program.
Sequence
- The order in which software instructions are carried out.
* instructions are carried out in the order they appear.
Function/Method
- A common sequence of instructions.
- Can be declared as void where a return value is not required.
- If a return value is required, it’s type must be defined.
Loop
Allows a statement or group of statements to be executed more than once.
Repeats a set number of times or until a condition has been met.
Unconditional Repitition
The number of repititions is unknown.
Eg for loop
Conditional Repition
The number of repetitions is known.
Eg while loop
Selection
In a program it is possible to decide which statements to execute.
IE if or switch statement.
If Statements
Allows control to branch to the execution of a set of instructions only if the condition evaluates to be true.
If/Else Statements
Same as if statement but will include statements to be executed if the evaluation of the condition is FALSE.
For Loop
The counter is initialised.
The end value for the counter is declared and the increment for the counter set.
do While Loop
Same as while loop.
Executes at least one time.
Executes first then checks for specified loop condition.
Nested Loop
A loop within a loop.
Used for more complex problems.
Switch Statements
Allows multiple decisions to be affected. If relevant result in more efficient code than multiple IF statements.
Switch- case statement
Control is transferred to the case statement which matches the switch variable.
Switch-break
Execution proceeds until break statement transfers control out of switch structure.
A branch statement usually required after each case block unless case has no code.
Console Application
A command driven interface which takes input and displays output at a command line console with access to 3 basic data streams.
•standard input
•standard output
•standard error
Windows Form Application
A window called a form is used. Objects are added to it. GUI is used to design form.
namespace
Used to declare a scope that contains and stores a set of related objects.
Can be used to organise code elements and store classes and subsequently methods.
class
Enables programmer to create custom types by grouping together variables of other types.
CamelCase
The first letter in a compound word is capitalised.
Most languages do not allow the use of spaces in the names of functions or variables.
assignment statements
Carry out assignment operations.
Consist of taking value on the right side of the operator (=) and storing it in the element on the left.
Instantiate
Declaring a variable in C#.
Creating an instance in which data is stored.
Method
A code block that contains a series of statements.
A program causes the statements to be executed by calling the method and specifying any required method arguments.