Programming Key Terms Flashcards
Define the term algorithm.
An algorithm is a set of instructions that performs a task.
What are the different types of data types?
Char
Boolean
Integer
Float
String
What is a constant?
A constant is a variable that can never be altered.
Give the pseudocode for printing “Hello World”
OUTPUT “Hello World”
Give the pseudocode for asking the user to input a string, and store it in the variable ‘string’.
string <– USERINPUT
What does the DIV operator do?
Gives an integer for every division, or the quotient.
10 DIV 4 = 2
What does the MOD operator do?
Returns the remainder of the operation.
3 MOD 2 = 1
What is the key term for converting a variable from one data type to another?
Casting
How can we convert a string to an integer in pseudocode?
STRING_TO_INT(variablename)
What are comments for in a program?
Describes the purpose of the program and helps other programmers understand the program
What is sequence?
Lines of code that are executed in order
OUTPUT “Hello”
OUTPUT “World”
What is selection?
A statement where a certain condition must be met
IF var = TRUE THEN
OUTPUT “TRUE”
ENDIF
What is iteration?
Repetition of a section of code.
For loop
While loop
REPEAT UNTIL loop (pseudocode)
Write the pseudocode for finding a random integer between 1 and 6, and store it in a variable.
var = RANDOM_INT(0, 6)
What is an array?
A data structure that can store multiple items of data of the same data type.
An array has a fixed length.