Fundamentals of Programming Flashcards
Pseudocode
Used to write instructions in statements that are somewhere between English and a programming language.
Assignment Statements
= or 🡨
Common Arithmetic Operations
+, -, *, / , **
Output/Input Statements
OUTPUT “”
🡨 USERINPUT
Identifier
A name that points to a memory location.
Assignment
Assigning a value to the memory location to create a variable.
Integer
Whole number.
Decimal/Float
Decimal number.
String
A collection of characters - a word.
Character
A singular letter/symbol.
Boolean
True or False value.
Variable
The value can be changed while the program is running.
Constant
To change the value of a constant, you have to change it in the source code and then recompile. Cannot be the target of assignment. Reduce the risk of errors by reducing access to the memory location.
MOD
Finds the remainder in integer division.
DIV
Returns the integer part of the division.
.len
Returns the length of string.
.find(“”)
Determines if “” occurs in the string.
Relational Operators
> greater than
< less than
=> greater than or equal to
=< less than or equal to
= equal to (== in Python)
<> not equal to (!= in Python)
IF…THEN…ELSE Statements
Control program
flow. Relational operators can be used to compare values within the
expression.
Complex Boolean Expressions
Boolean expressions can include AND, OR and NOT.
ELSE IF
Can be used to evaluate multiple expressions.
CASE
Can be used to evaluate multiple expressions.
Iteration
Repetition. A sequence of instructions is repeated multiple times. This is much more efficient than writing the instructions multiple times. The number of repetitions needed may vary.
WHILE…ENDWHILE Loop
The condition is tested upon entry to the loop. It is possible that the instructions inside the loop might not be executed at all if the entry condition is not met.