A question in a program requires a true or false response.
State the most suitable data type for storing this response.
Was this exam question helpful?
Exam code: X816 75
A question in a program requires a true or false response.
State the most suitable data type for storing this response.
How did you do?
Was this exam question helpful?
A company runs a sightseeing trip around Iron Craig Island each Saturday and Sunday. Their boat can hold 100 passengers.
Every weekend the available tickets are numbered as follows.
Saturday’s ticket numbers | 1 to 100 |
Sunday’s ticket numbers | 101 to 200 |
A program is being developed to:
allow the company to check the validity of each passenger’s ticket as they board the boat
calculate and display the total number of the passengers on each trip.
The program design is shown below.

The total number of passengers is set to 0.00 in the design.
State a more appropriate data type to store the total number of passengers. Give a reason for your answer.
Data type................................................................................................
Reason.....................................................................................................
How did you do?
Was this exam question helpful?
A program is required for passengers to book a ticket on a bus.
Passengers must enter their destination and their age when making a booking, as some will qualify for free travel.
Complete the table below to state the most suitable data types that should be used.
Variable name | Sample data | Data type |
passengerAge | 78 | |
destination | Ullapool |
How did you do?
Was this exam question helpful?
A new supermarket self‑service till is being designed for customers. Part of the program design is shown below.


State the most suitable data type for the variable that will be used in the ‘is conveyor belt empty?’ step.
How did you do?
Was this exam question helpful?
In an archery game, players score points when they hit the target.
The points entered are whole numbers in the range 0 to 10.
The game has 10 rounds and each player shoots two arrows in each round.
The program below is written to record a player’s score.
…
Line 24 SET totalScore TO 0.00
Line 25 SEND "round1" TO DISPLAY
Line 26 RECEIVE arrow1 FROM (REAL) KEYBOARD
Line 27 RECEIVE arrow2 FROM (REAL) KEYBOARD
Line 28 SET roundTotal1 TO arrow1 + arrow2
Line 29 SET totalScore TO totalScore + roundTotal1
…
Line 70 SEND "round10" TO DISPLAY
Line 71 RECEIVE arrow19 FROM (REAL) KEYBOARD
Line 72 RECEIVE arrow20 FROM (REAL) KEYBOARD
Line 73 SET roundTotal10 TO arrow19 + arrow20
Line 74 SET totalScore TO totalScore + roundTotal10
Line 75 < display all ten round totals >
Line 76 SEND "TotalScore: " & totalScore TO DISPLAYA tester enquired why the total score was displayed as below:
Total score: 180.60 |
Explain the problem with the program that this output has highlighted.
How did you do?
Was this exam question helpful?
A confectionery company requires a program to store information about boxed chocolates.

Complete the table below to state which types of variable should be used.
Variable | Type of variable |
chocolateName | |
inStock | Boolean |
numberOfChocolatesInBox |
How did you do?
Was this exam question helpful?
A competition was run to suggest names for a new bridge. The 20 most popular bridge names have been identified and stored.
State the most suitable data structure used to store the bridge names
How did you do?
Was this exam question helpful?
The program code below protects the rechargeable battery in an electric toothbrush.
…
Line 67 SET brushstop TO FALSE
Line 68 WHILE brushstop = FALSE DO
Line 69 SET battery TO <percentage of power left>
Line 70 SET temperature TO <temperature of battery>
Line 71 IF battery < 3 OR temperature > 45 THEN
Line 72 SET brushstop TO TRUE
Line 73 END IF
Line 74 END WHILE
Line 75 <switch toothbrush off>
…Describe the purpose of the Boolean variable in this code.
How did you do?
Was this exam question helpful?
A 9-hole golf course is introducing an app to replace paper scorecards. The total score is the number of times the player hits the ball to complete all 9 holes.
Below is an example of a paper scorecard that a player has filled in.

The final scores are stored within the app.
State the most suitable data structure and data type for storing the final score for each hole.
Data structure...............................................................................................
Data type.....................................................................................................
How did you do?
Was this exam question helpful?
A club requires a program to calculate how much each member needs to pay in membership fees.
Complete the table below to state which type of variable should be used.
Variable | Sample data | Variable type |
membershipFee | 37.50 | real |
yearsOfMembership | 6 | |
memberName | Jones |
How did you do?
Was this exam question helpful?
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.

A pupil must enter A, B, C or D to cast their vote.
(i) State the most suitable data type for storing the vote.
[1]
(ii) Using a design technique of your choice, design a solution that will allow only these values to be entered.
[4]
How did you do?
Was this exam question helpful?
In a flight booking app, users are asked to enter their departure airport, destination airport, departure date, return date, number of adults and number of children.
A message will then be displayed showing the total flight cost and the duration of the trip.
Passengers are allocated an available seat. A data structure named seats is used to store whether each seat is available (true) or unavailable (false).

(i)State the most suitable data structure and data type used to store the seat availability.
[2]
(ii)The following pseudocode design shows how an available seat is allocated.
generate a random seat number
loop while the generated seat is unavailable
generate another random seat number
end loop 5 change seat to unavailable
Using a programming language of your choice, write the code required to implement the above design.
[4]
(iii)Explain why the above design becomes less efficient as more passengers are allocated seats.
[2]
How did you do?
Was this exam question helpful?