3.2 Programming Flashcards
What is Declaration?
reserving space in memory for a variable
What is Assignment?
Saving a value into a variable
What is a Variable?
A named space in memory that can change
What is a Constant?
A named space in memory that can’t change
What is a Data Type?
Type of data that can be stored e.g. integer
What is Input?
What the user types in
What is Output?
What the computer displays onto the screen
What is Casting?
Changing from one data type to another
What is Concatenation?
Joining data together
What is Commenting?
Adding non-executional code to your program
Why declare a constant instead of a variable?
-To tell the programmer the constant should not change
-This way it won’t accidentally change the value of it
What are the naming conventions?
camelCase and snake_case
What is an output statement?
How are they written in VB and Pseudocode?
What the computer displays onto the screen
-VB: console.writeline(“”) OR console.write(“”)
-Psuedocode OUTPUT “”
What is an input statement?
How are they written in VB and Pseudocode?
Input statements is what the user types in.
The input can be assigned to variables.
In VB you use
{variable} = console.readline()
In Pseudocode you use
{variable} ← USERINPUT
What is the difference between Pseudocode and VB?
They use a variety of different symbols and code. For example VB uses = to assign a variable whereas Pseudocode uses ←.
Why is casting useful?
It can be used to turn a string into an integer so it can be useful for maths problems
It can also turn an integer into a string so you can add decimal places i.e. 10.00
Why is commenting useful?
It can tell the programmer what the code is doing
You can comment out code to see where it is going wrong (debugging)
Why is it important to name variables and constants as meaningful identifiers?
So you know what their purpose is.
What is selection?
Performing a logical test to see what code to execute (i.e. IF… THEN… ELSE)
What is iteration?
Repeating code
What is definite iteration?
Code that is repeated a known amount of times (i.e. FOR i ← 0 TO 9)
What is indefinite iteration?
Code that is repeated an unknown amount of times, it is repeated until a certain condition(s) is met.
(i.e. WHILE anotherGo = FALSE)
What is nested iteration?
Iteration inside of iteration
(loop inside of a loop)
What is the difference between While and Repeat Until (or Do Loop Until in VB)
While checks condition at the start
Do / Repeat Until loop checks condition at the end
What does Dim achieve in VB?
Declares a variable.
What does Const achieve in VB?
Declares a constant
What is string handling?
It is used to check and manipulate strings