Software Design and Development (Implementation: Computational Constructs) Flashcards
What are Variables?
Variables are what identifies where items are stored in the RAM. They hold data which will be used in the processes that the program will carry out
What must we always give each variable?
A name or identifier
What must we make sure about variable names?
That they are easy to understand
eg. “score” instead of “s”
How do we assign a value to a value while it is running?
SET variable TO variable+1
What are the five arithmetic operators and what are there symbols?
Add (a+b) Subtract (a-b) Multiply (a*b) Divide (a/b) Exponent (a^b)
What is Concatenation?
Concatenation is when strings/characters are joined together
eg. SET displayName TO firstName & “ “ & surname
SEND displayName TO DISPLAY
This would send whichever was the first name and surname together with a space in the middle
What is used to make logical decisions in a program?
IF statements
How are the five logical constructs written and what are there names?
< (Less than) > (More than) <= (Less than or equal to) >= (More than or equal to) = (Equal to)
What are the three logical operators?
AND
OR
NOT
What is the purpose of the AND function?
Both conditions must be met
eg. IF age>18 AND age<25
This example allows only data which is one of either 19, 20, 21, 22, 23, or 24
What is the purpose of the OR function?
Either (or both) conditions must be met
eg. IF drink=”cola” OR drink=”lemonade”
This means that the data could only be one of either “cola” or “lemonade”
What is the purpose of the NOT function?
Opposite of the condition must be met
eg. IF NOT (score=0)
This example allows data which is not 0, such as 5, to be accepted
What are the two kinds of loop?
Fixed Loop
Conditional Loop
What is the difference between Repetition and Iteration?
Repetition is when a program repeats certain lines of code several times whereas Iteration is when a program will repeat certain lines of code until an outcome is achieved
What are Fixed Loops?
Fixed Loops are when code is to be repeat a set amount of times (Repetition)