Design (SQA National 5 Computing Science): Exam Questions

Exam code: X816 75

1 hour14 questions
1
4 marks

A cinema is developing an app to survey customers. Cinema staff will ask customers questions as they leave the cinema. Staff will use a touchscreen on a tablet to input and submit the responses given by each customer.

Customers will be asked the following questions:

  • Which of the two films the cinema is currently showing did you see?

  • What score would you give the film, from 1 to 5?

  • Did you purchase food in the cinema?

As many customers as possible should be surveyed as they leave the cinema. It is important that answers to questions can be input as quickly as possible using a touchscreen.

Using the information above, design a user interface for this part of the app.

2
1 mark

A new supermarket self‑service till is being designed for customers. Part of the program design is shown below.

Grocery store checkout area with conveyor belt, cash register, card reader, and shopping bag. Shelves filled with products are visible in the background.
Flowchart showing a checkout process: add items to conveyor, scan, add price to total, check if empty, repeat if not, display total if yes.

State the design technique shown above.

3a
4 marks

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.

Using a design technique of your choice, refine step 2.

3b
4 marks

The gym manager wants to set up tablet computers at the door to carry out a survey as people leave the gym.

The survey should ask if they are a member or a pay‑as‑you‑go customer, and if they were attending the gym or a fitness class. The survey should also ask people to rate their visit, from 1 to 10, and have a space for any additional comments.

Design a user interface for this survey

4
3 marks

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 DISPLAY

When this code is evaluated it is found to be inefficient.

Explain how to make this code more efficient.

5
3 marks

A parking fine is £130. If this fine is paid within 14 days the fine is halved.

A design for a program to calculate the fine depending on when it is paid is shown below.

  1. Set fine to 130

  2. Get number of days since fine was issued

  3. Calculate and store fine

Using a design technique of your choice, refine step 3 of the design.

6a
1 mark

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 for calculating party cost, including child buffet price, cake and venue fees, number of adults and children, and dietary requirements.

State another design technique that could be used to design this program.

6b
6 marks

A personalised party sweatshirt costs £12, with each character of the personalised message costing an additional 25p.

(i) Using a design technique of your choice, design a program to store the user’s message and output the total cost of the sweatshirt.

[4]

(ii)The washing label on the sweatshirt has the following symbol.

A black dot centred within a circle, which is inside a square, representing a simple geometric design.

Identify an object used to make this symbol and one of its attributes.

[2]

7
1 mark

A program is being designed to control the gas burner on a barbecue.

Flowchart for barbecue control: Set desired temperature, turn gas on, get sensor temperature, display it, check if below desired. If false, turn gas off.

State the design technique shown above.

8
2 marks

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.

Scorecard for Sanya Abioye dated 25/5/2023, detailing scores for nine holes with a total score of 46.

The following user interface is designed for the player to enter their score for each hole.

Golf scorecard app interface showing Hole 2 score as 8. Features a keypad for score entry, and instructions to submit after all 9 scores are entered.

Give two reasons why this user interface design is not fit for purpose.

9
4 marks

A communications company uses a program to calculate a customer’s average data usage over a 12-month period.

An example of a customer’s monthly data usage in gigabytes (GB) is shown below.

…..

Feb

March

April

May

June

July

Aug

........

50

41

30.8

35.7

32.7

23

19

The design below shows how a customer’s average monthly data usage is calculated and displayed.

Algorithm

  1. Store each month’s data usage

  2. Calculate the average monthly data usage

  3. Display the average monthly data usage

The data structure month is used to store the data usage.

The variable aveData is used to store a customer’s average monthly data usage.

Using a design technique of your choice, refine step 2.

10
2 marks

A train company is designing a program to handle passenger complaints. Part of the design is shown below.

Flowchart showing a complaint process: check for delay, review, display outcome, check satisfaction. If satisfied, display "Thank you, your case is now closed."

When a train is delayed, passengers are entitled to a 25% refund on the cost of their ticket.

Using a design technique of your choice, show how the refund would be calculated.

11
5 marks

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.

The design below shows how the total cost of a booking is calculated.

Algorithm

Find ticket costs

  1. Get quantity of passengers

  2. Calculate initial cost of booking

  3. Update cost of booking if bag(s) are added

  4. Display final cost of booking

Refinements

2.1 Get quantity of adult passengers

2.2 Get quantity of child passengers

12a
3 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.

Using the information above, design a user interface for the program.

12b
4 marks

Sam completes five jobs in July and earns the following.

£562.77, £675.44, £287.91, £245.22, £899.66

The following section of code calculates Sam’s monthly earnings for July.

Line 1 DECLARE total INITIALLY 0.0
Line 2 DECLARE job1 INITIALLY 0.0
…
Line 7 RECEIVE job1 FROM KEYBOARD
Line 8 RECEIVE job2 FROM KEYBOARD
Line 9 RECEIVE job3 FROM KEYBOARD
Line 10 RECEIVE job4 FROM KEYBOARD
Line 11 RECEIVE job5 FROM KEYBOARD
Line 12 SET total TO = job1 + job2 + job3 + job4 + job5
Line 13 SEND "Total Monthly Earnings £" & total TO DISPLAY
…

When evaluating this code, it is found to be inefficient.

Using a programming language of your choice, re-write Lines 7 to 12 of the code using more efficient constructs. The values for the five jobs should remain stored for use after Line 12.

13a
3 marks

A cinema is developing an app to survey customers. Cinema staff will ask customers questions as they leave the cinema. Staff will use a touchscreen on a tablet to input and submit the responses given by each customer.

Customers will be asked the following questions:

  • Which of the two films the cinema is currently showing did you see?

  • What score would you give the film, from 1 to 5?

  • Did you purchase food in the cinema?

Flowchart for calculating average scores of films A and B from customer input via touchscreen, updating totals, and displaying results.

Read the design for the cinema app and identify

(i) a value that will be stored as an integer

[1]

(ii) the condition used in the loop

[1]

(iii) an inefficient part of the design that could be removed without affecting the solution.

[1]

13b
2 marks

Before the design is implemented, the following test data is created.

Type of test

User input

Normal

A
10
B
8
A
2
B
8

The design does not calculate the average score for each film correctly.

(i) State the average score for each film that this design will output.

Film A ....................................................................................................

Film B.....................................................................................................

[1]

(ii) Describe how the design should be edited to calculate the correct average scores.

[1]

14a
2 marks

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

(i) Pseudocode was used to design the program. State another technique that could be used to design the program.

[1]

(ii) The software development process is described as iterative. Explain why it may be necessary to return to the design stage.

[1]

14b
6 marks

(i) The user can search for properties priced from £50,000 to £600,000.

Using a design technique of your choice, design an efficient solution to check that the price entered is valid.

[4]

(ii) Test data is used to ensure the validation of the price entered works correctly.

Complete the test table below with one appropriate numerical value for each input.

[2]