1. Flashcards
What are the 5 common data type?
Integer
Real/Float
Character
String
Boolean
What are the Arithmetic operators?
Less than <
Greater than >
Less than or equal to <=
Greater than or equal to >=
Not equal to <> or !=
Equal to ==
- What are the rules for creating a trace table?
They are used to check your algorithm gives the wanted output.
- A column is needed for each variable and a column for the output.
- Start a new row every time you need to declare a variable change.
- If the variable doesn’t change or is a constant keep it the same throughout the table or keep it same at the top and leave the column blank.
What is a subroutine and what are the two types?
A section of code that performs a specific task that can be used over and over again.
Functions and Procedures.
What is the difference between a function and a procedure?
A function is called upon and returns a value.
A procedure is also called and also can have parameters but doesn’t return a value.
Why do we use functions and procedures.
they are used so that code doesn’t become too long (decomposition). using parameters means that the code can be reused over and over again. Helps with decomposition.
What is a method?
Name for a subroutine normally in a class/OOP.
What are the 3 types of scopes?
Global
Local
Variable
What is global scope?
The variable is recognised throughout the code and can be used at anytime.
What is local scope?
variable only recognised in small area of code, e.g. subroutine.
What is variable scope?
Variable is recognised as being able to be called in that small section of code.
What is ASCII?
Stands for American Standard Code for Information Interchange and contains 128 characters for the majority of languages.
What is Unicode?
Stands for Universal Character Encoding that uses 4 bytes per character and with the first 128 characters being the same as ASCII is compatible.
What is the difference between ASCII and Unicode?
Unicode3 can represent more characters and languages including emojis, ASCII uses 7 bits and Unicode uses 8 bits.
Why is data represented in binary?
Easier to understand and manufacture, therefore more reliable and cheaper.
What is an array?
zero based, fixed length (static), store elements of one data type, that are held in contiguous memory, 1D/2D/3D accessed using index (each elements position in the array is known as its index).
What are the 3 common bases for numbers?
Binary (base 2).
Denary (base 10).
Hexadecimal (base 16).
Why do we use hexadecimal?
They provide a human friendly representation of binary coded values, each hex digit is 4 binary digits, it is easier therefore to work with hexadecimal.
How do you declare an array in pseudocode?
array example [row][column]
What is the length of the number of rows in a 2D array?
example.length
What is the length of the number of columns in a 2D array?
example[0].length
What is the difference between an argument and a parameter?
A parameter is a variable name used in the subroutine.
An argument the exact value is passed into a subroutine.
What is a file?
Data that is stored in which it occurs.
Write - either create a new file or append to the end of the file line by line.
Read - start at the top of the file and move down the file line by line.
You cannot read and write to a file at the same time.
What is the pseudocode for printing all the lines from a file?
myFile = openRead(“sample.txt”)
while NOT myFile.endOfFile()
print(myFile.readLine())
endwhile
myFile.close()
What is the pseudocode for writing one line to a file?
myFile = openWrite(“sample.txt”)
myFile.writeLine(“Hello World”)
myFile.close()
What is the pseudocode for reading one line from a file?
myFile = openRead(“test.txt”)
line = myFile.readLine()
myFile.close()
In HTML what is a class?
Used to style multiple elements - defines equal styles for elements
In HTML what is an identifier (ID)?
Singular version of class