Topic 6 And 7 Flashcards
What is an integer?
Int
Whole number only
What is a float or real?
Numbers that can have decimal part
What is a Boolean?
Can only take one or two values, usually true or false
What is data type character?
Single letter number of symbol
What is data type string?
Used to represent text with selection of characters
How to workout ASCI number of the letter?
ASC(letter)
How to work out which ASCI number is which letter
CHR(code)
What does DIV
Divides into a whole number and has no remainder
What does MOD Do
Show the remainder of a calculation
What does .upper do?
Changes all characters to upper case
What does .lower do?
Changes all characters to lower case
What does .length do ?
Returns the number of characters in a string
What does .left do?
Returns the left character
What does .right do
Returns right characters
What does .substring do?
Extracts a substring from the string
Describe a DO until loops
Controlled by a condition that has to be met
Always run at least once
You can get an infinite loop if the statement is impossible
Describe a while loop
Controlled by a condition at the start
Keep going while condition is true
Never run code if condition is initially false
Get and infinite loop if conditions is always true
Describe a logic gate
Triangle flowing from input to output with a circle
Describe an and gate
A square with rounded top with two inputs and one output
Describe an or gate
Looks like the Star Trek sign
Function of a Not Gate
It reverse the input or gives the opposite input
What is the function of an and gate
Both inputs must be true for a positive result
What is the function of an or gate
One or more inputs must be true for a positive result
How to code an array
Create be typing array “then array name” [num if element ]
Assign each element a number e.g
Array rowers [4]
Rowers [1] Alfie
Rowers [2] Sid
Rowers [3] Noah
Rower [4] jack
How to call an array
Print( name of array and array number)
Eg print(rower [4])
How to open a file
File = open(“file.txt”)
How to create new file
Newfile(“myfile.txt”)
How to write lines in a file
Writeline()
How to read lines form a file
Readline()
How to close file
Close ()
What is procedure
A set of instructions that can be called under 1 name that do not return data
Functions
Are sets
What is a local variable ?
A variable that can only be used in the structure that declared in
What is a global variable?
Variables that can be used any time after the declaration
What is a high level language?
Source code that is easy for human to write as it is close to English
What are low level language
Languages that are hard for human to write as they a far from English
What language to computers understand
Machine code
Why do we need translators
To translate high level languages into machine code
What are the two types of translators
Compiler and interpreter
What does an interpreter do?
Translate code on instruction at a time
Needed every time the program is run
Will return the first error
Slower
What does a compiler do?
Translates the while script
Only need once
Returns list of errors
Runs quicker
What is a IDE
Integrated development environment a piece of software to help the developers
Features of an IDE
Translators
Auto documents
Graphical user interfaces