Unit 1 Rob Flashcards
What is a variable?
Variables are data values that can change when the user is asked a question, for example, their age.
Constants in C#
Constants can NOT change whilst the program is running, e.g const int passMark= 40;
What are the most common data types and what it does
boolean - true/false
Character - Single character
date/time - date and/or time
double - a number with a decimal such as 2.3
floating point. a number with a decimal e.g 4.5f
integer - A whole number
string - holds zero or more characters such as letters, numbers, spaces etc.
What are the there basic programming constructs:?
Sequence - the order in which instructions occur and are processed (order)
Selection - determines which path a program takes when it is running (IF)
Iteration - is the repeated execution of a section of code, when a program is running(LOOP)
What are the four basic programming operators?
Logical - AND OR NOT
Comparison - == = >= < ! =
Assignment - =
Arithmetic - + - * / DIV MOD
What is a sequence?
Sequence is the order in which instructions occur and are processed and if no conditions they’re done in order
What is a selection?
A selection determines which path a program takes when it is running, so the user is asked a question and if its answer is yes it will do 1 task and if the answer is no it will do another different task depending on the answer something will be done.
Iteration
Iteration is the repeated execution of a section of code when a programming is running until its complete (LOOP).
What is a logical operator?
AND OR NOT
What is a Comparison/relational operator?
== =>= < !=
What is an assignment operator?
=
What is an arithmetic operator?
+ - * / DIV MOD
What is readability?
refers how easy it is to read and understand code
What are the different types that help with readability?
Comments
Indentation
Naming
What is a comment?
Codes can be used to explain C# and to make it more readable, any text between // and the end of the line is ignored by C# and is just some text to help understand the code, and will not be executed.