Computer Assignment 15
Computer Assignment 15
Assignment
Refer to the insert for the list of pseudocode functions and operators.
1 (a) (i) Complete the following table by giving the appropriate data type in each case.
(ii) Evaluate each expression in the following table by using the initial data values shown in
part (a)(i).
Expression Evaluates to
Modified OR Index > 100
LENGTH("Student: " & Name)
INT(Index + 2.9)
MID(Name, 1, 3)
[4]
(b) Each pseudocode statement in the following table contains an example of selection,
assignment or iteration.
Put one tick (‘✓’) in the appropriate column for each statement.
X S2
S1
Answer
The number of transitions that result in a different state
The number of transitions with associated outputs
The label that should replace ‘X’
The final or halting state
[4]
A B
Dolphin Cat Fish Elk
............................................................................................................................................. [1]
(b) Give the technical term for the item labelled A in the diagram.
............................................................................................................................................. [1]
(c) Give the technical term for the item labelled B in the diagram.
Term ..........................................................................................................................................
Meaning ....................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
[2]
(d) Complete the diagram to show the ADT after the data has been sorted in alphabetical order.
[2]
4 A teacher uses a paper-based system to store marks for a class test. The teacher requires a
program to assign grades based on these results.
The program will output the grades together with the average mark.
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
.................................................................................................................................................... [6]