Software Design and Development - Implementation Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How do you assign a value to a variable?

A
Assigning a value to a variable e.g.
In reference language
      SET score TO 20
In Livecode
      put 20 into score
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you use Arithmetic in a program?

A
Using arithmetic (+, -, /, *, ^) e.g.
In reference language
          SET total TO total + score
In Livecode
put total + score itno total
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is concatenation?

A

Joining two or more strings or substrings
For example in Livecode:
put firstname & “ “ & surname into fullname
Would join first name and surname and include a space between both
In Reference language:
SET fullname TO firstname + “ “ + surname

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What selection constrcuts can be used?

A
<  Less than
>  Greater than
≤  Less than or equal to
≥  Greater than or equal to
=  Equals
≠  Does not equal
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an IF statement?

A

An If statement IS NOT A LOOP. IF statements allow
the program to make decisions. Conditions, such as
score <10 are used within IF statements.
IF score < 10 OR score >50
SEND ‘Try Again’ TO DISPLAY
END IF
This IF statements checks to see if a score is less than 10 or higher than 50

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a nested IF statement?

A
Nested IFs are IF statements inside IF statements. 
The nested parts only run if needed.
IF score < 100 THEN
   SEND “Low Score” to DISPLAY
ELSE
IF score < 150 THEN 
   SEND “Mid level score” TO DISPLAY
ELSE
   SEND “High score” TO DISPLAY
END IF
END IF
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are Logical Operators?

A

Logical operators can be used in
IF statements and conditional loops.

AND – Both conditions must be true

OR – One condition must be true

NOT – The opposite outcome to what would logically apply (negation)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a simple condition?

A

A simple condition has only one condition e.g.
IF firstname = “Betty”
The condition is = “Betty”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a complex condition?

A

A complex condition has two or more conditions e.g.

IF firstname = “Betty” OR firstname = “Trevor”

The two conditions are = “Betty” , = “Trevor”

AND /OR are used as part of complex conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is repetition / iteration?

A

Repetition and iteration are technical terms for
loops. Repetition repeats a task set number of times. Iteration is the same but usually involves checking
over the contents of an array until you achieve what you want to achieve e.g. find a number or get to the end of the array list
.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is a fixed loop?

A

A fixed loop will repeat all code held within the loop a
set number of times only. E.g.
For loop = 0 to 9
<code>
Next loop
The above loop would repeat 10 times</code>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a conditional loop?

A

A conditional loop repeats until a condition is met e.g.
WHILE score < 10
<code>
END WHILE
This loop will repeat the code inside as long as the score variable holds a value that is less than 10</code>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the ROUND function?

A

ROUND is a pre-defined function, meaning the code
to make it work already exists. If you use
the ROUND function, the computer will round a value to a certain number of decimal places:

SET size TO ROUND (measurement, 1)

This takes the value of the measurement variable and rounds it to one decimal place. It then returns this new value to the size variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is the RANDOM function?

A

RANDOM is a pre-defined function, meaning the
code to make it work already exists. If you use the RANDOM function, the computer will generate a random number:
SET bonusBall TO RANDOM(1, 59)
This would generate a random number between
1 and 59 and returns this number to the bonusBall variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the LENGTH function?

A

LENGTHis a pre-defined function, meaning the code to
make it work already exists. If you use the LENGTH function, the computer will calculate the number of characters held in a string variable:
SET numberOfCharacters TO LENGTH (firstname)
This would take the value in the first name variable, calculate its length and returnsit to the numberOfCharacters variable. E.g. Jane would return
4

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe the INPUT VALIDATION algorithm

A

This algorithm checks that input is valid:
Line 1 SEND “Enter a score between 1 and 99” TO DISPLAY
Line 2 RECEIVE score FROM (INTEGER) KEYBOARD
Line 3 WHILE score ˂1 OR score ˃99 DO
Line 4 SEND “Error, enter valid number” TO DISPLAY
Line 5 RECEIVE score FROM (INTEGER) KEYBOARD
Line 6 END WHILE

17
Q

Describe the RUNNING TOTAL algorithm

A

This algorithm keeps a running total:
Line 1 DECLARE total INITIALLY 0
Line 2 FOR loop FROM 0 TO 4 DO
Line 3 RECEIVE number FROM (INTEGER) KEYBOARD
Line 4 SET total TO total + number
Line 5 END FOR
It asks for and keeps a running total of 5 values.

18
Q

Describe how to traverse a one dimesional array

A

To traverse an array means to use a loop to go
through the array one item at a time.

DECLARE allGrades INITIALLY [A, B, B, D, F]
FOR EACH grade FROM allGrades DO
IF grade = 'A' THEN
    SET a_total TO a_total +1
END IF
END FOR EACH

In the above example, each item in the all Grades array is checked one after another, with a running total also
calculated.