Programming Fundamentals Flashcards
String
Text - “Hello”
Integer
Whole number e.g. 32
Float/Real
Decimal number e.g. 12.1
Boolean
True or False
Charecter
A single charecter e.g. b
Casting
is when you want to change between data types
Variable
can be assigned value during the program
Local Variable
a variable that can only be used in the structure they are declared in
Global Variable
a variable that can be used in any part of the code
Constant
A value that can not be altered whilst the program is running
Assignments
A statement that sets a value to a variable
Exponentiation
Raises a number to a power
Quotient/DIV
Give a whole number after a division
Remainder/MOD
gives the remainder part of a division
==
is equal to
! <>
is not equal to
<
is less than
>
is more than
> =
is more than or equal to
<=
is less than or equal to
What are the boolean operators
AND, OR and NOT
One dimension array
like a list
examples:
array students [3]
students [0] = “Bob”
students [1] = “Dave”
students [2] = “Bob”
print (students[1])
Two dimension array
These are lists within lists like a table.
Sequence
Programs is completed in steps one after the other.
Selection
where there are different paths in your code
e.g. elif, if, else
Iteration
When there is repetition in code for example a WHILE loop
Function x.length
Give the lengths of the string
Function x.upper
Changes it to upper case
Function x.lower
Changes it to lower case
Function x[i]
Give the charecter in position i
Function x.substring(a,b)
give the characters from position a with the length b
Function +
joins to strings together
File Handling - Myfile=openRead(“myfile.text”)
Opens a file in read mode
File Handling -Myfile=openWrite(“myfile.text”)
Opens the file in write mode
File Handling - Myfile.writeLine (“Hello”)
Writes a line to the file
File Handling - Line1=myfile.readLine()
Reads one line of the file
File Handling - Myfile.close()
Closes the file
File Handling - endOfFile()
Used to determine the end of the file
Procedures
a set of instructions stored under a name so that you
can call the procedure to run the whole set of instructions.
Parameters
variables used to pass values into a function or procedure.