DTE t2y9 Flashcards
(30 cards)
What is an algorithm?
An Algorithm is a set of steps you must follow to achieve an outcome
What is a variable?
A variable is a named placeholder in memory that can store information/data and can be changed. OR it is a container that holds a value
What are some examples of variables?
- A score or current level on game called score
- A mobile phone number called mobileNumber
- A name called firstName; surname
What are the types of variable names?
The names that you give a variable is important. Variable names must be meaningful and descriptive. A variable with two word can be used as:
camelCase
kebab-case
snake_case
What are the 4 variable guidlines?
- cannot start variable name with number
- Cannot start with an uppercase letter
- Cannot have spaces
- Must be unique
What is an integer?
Any whole number such as -17, 2, 10
What is a float?
A decimal number because the decimal point “floats” such as 5.4, 0.2
What is a character?
A single alpha character such as: H, &, #
What is a string?
A series of characters such as book name, heading or address
What is a date?
Anything such as 5/05/2025
What is time?
generally in 12 hour clock
What are the two types of an algorithm?
Flowchart and pseudocode
What is pseudocode?
plain language description of steps in an algorithm
What are the six keyword groups of psuedocode?
- BEGIN, END
- INPUT
- OUTPUT or PRINT or DISPLAY
- IF, THEN, ELSE, END IF
- FOR, TO, DO, NEXT, ENDFOR
- WHILE, ENDWHILE
What is the rule in writting key words of pseudocode?
They must be bold and capital
What are + used for in pseudocode?
Plus signs are not maths they are just used for linking words together.
What is * used for in pseudocode?
Multiplication
What is the % used for in pseudocode?
It is called modules and it means when you divide by a number what is the remainder. For example, 5 % 2 is one remainder.
What is the == mean in pseudocode?
It means if something equals that. It is not directly assigning it to a value like a normal = would do but it is saying IF it equals that.
What does <> mean in pseudocode?
Not equivalent to
What does AND mean in pseudocode?
Both sides of the equation must be true
What does OR mean in pseudocode?
Either side of the equation must be true
What does NOT mean in pseudocode?
When something isn’t true
What are the two types of iteration?
Fixed loop and not fixed loop. A fixed iteration is telling the computer specifically how many times you want it to loop. You can also have a not fixed iteration where you can create a variable iteration so while the variable is true it will continue to loop through