Computer Structure (SQA National 5 Computing Science): Exam Questions

Exam code: X816 75

16 mins9 questions
1
4 marks

A spelling game stores 20 words. Each word has an accompanying sound file where an actor’s voice speaks the word.

When the game is running the program repeats the following 20 times:

  • selects one of the 20 words

  • loads a sound file matching the selected word

  • plays the sound file through a speaker

  • asks the user to type in the word

  • compares the user’s entry to the stored word

  • informs the user if they have spelled the word correctly.

When the game is over the program displays the total number of words that have been spelled correctly by the user.

The spelling game stores 20 words.

(i) State the data structure and data type that will be required to store the 20 words.

[2]

(ii)State where in the computer system the 20 words will be stored while the program is running.

[1]

(iii) State the part of the processor that will compare the selected stored word with the user’s input.

[1]

2
2 marks

Luna Life is a company that creates animations.

State the part of the processor used, during the calculation of the discount, to:

(i) perform the calculation

[1]

(ii) temporarily store the values used in the calculation.

[1]

3
1 mark

A gym wants to encourage members to burn more calories than their monthly target.

It uses a program to calculate additional calories burned over a 12‑month period.

April

May

June

6821.34

5129.89

4997.67

The design below shows how a member’s average additional calories burned is calculated and displayed.

  1. Store each month’s additional calories burned

  2. Calculate the average additional calories burned

  3. Display the average additional calories burned

The data structure calories is used to store additional calories burned each month. The variable avgCalories is used to store the user’s average additional calories burned.

After final testing, the program is run without requiring any further translation. State the type of translator that has been used.

4
2 marks

An event company organises children’s parties. They would like a program to help calculate the costs of parties.

Part of the structure diagram design is shown below.

Flowchart showing party cost calculation: child buffet cost, cake decision, adult/child count, venue cost based on guest number, child dietary requirements.

Once the program is implemented, state which part of the processor will execute the following tasks.

Task

Part of processor

Calculate cost

Transfer the next instruction from memory

5
1 mark

Edge Races are developing a program to process information on races with multiple stages.

The first race has four stages as shown below.

Race one

Stage

Distance (km)

1

19.9

2

6.5

3

35.2

4

20.0

The design for part of the program is shown below.

6.1 Loop 4 times

6.2 Get valid distance for stage

During execution the code is translated.

State the type of translator that has been used.

6
1 mark

Curling is a sport where stones are thrown down a lane of ice towards a target. In the example below, stone B is closest to the middle of the target and is the winner.

Two curling stones on an ice sheet, labelled A and B, are positioned near the centre of a circular target area with concentric rings.

A computer program calculates the distance of each stone from the middle of the target. The code below has been written to identify the winning stone but produces the wrong output.

…
Line 20 IF stone_A_distance < stone_B_distance THEN
Line 21 SEND "Stone B is the winner." TO DISPLAY
Line 22 ELSE
Line 23 SEND "Stone A is the winner." TO DISPLAY
Line 24 END IF
…

State the part of the processor used to compare stone_A_distance to stone_B_distance.

7
2 marks

Tarvit High School is trialling a voting system to decide their representative for the pupil council. A programmer creates a voting app to allow pupils to cast their vote. The winner is displayed once voting is closed.

Voting image for 2023 Tarvit High School Pupil Council Representative. Lukasz Kowalski selected, with current votes: Hendry 22, Murphy 13, Kowalski 19, Green 21.

The following code displays the number of votes for each candidate.

…
Line 22 REPEAT 4 TIMES
Line 23 < display candidate name and number of votes >
Line 24 END REPEAT
…

Before the code is run it must be translated.

Complete the table below to identify the type of translator that should be used for each effect.

Type of translator

Effect

Loop will be translated once and converted into machine code

Loop will be translated four times as the program is run

8
1 mark

A program is being designed to allow users to search for properties for sale.

After final testing, the program is run without requiring any further translation software.

State the type of translator that has been used.

9
2 marks

. Sam is creating a program to calculate and display the total cost of laying new flooring. Flooring is charged at £15 per square meter and skirting boards are charged at £60 per room.

The total cost is calculated by multiplying the total floor area by 15, then adding the number of rooms requiring skirting multiplied by 60.

(i) State the part of the processor that will perform the calculation once the program is implemented.

[1]

(ii) State the part of the processor used to temporarily store the result of the calculation.

[1]