That Blue Square Thing

This page includes tooltips. Mouse over them to get a brief explanation of what something means.
Tootips might not work so well on phones or tablets. Sorry.

AQA Computer Science GCSE

Programming Exam Question – Go-kart braking distance

This is an eight mark paper 1 programming question. It was question 18 on the specimen exam paper – the last question on the exam paper.

I suggest trying to write an answer by hand first and then attempting to program your answer. Does it work? What did you get wrong?

The Question:

Write a Python program that calculates an estimate of the braking distance in metres for a new model of go-kart that is travelling between 10 and 50 kilometres per hour (kph).

The program should:

You should use meaningful variable name(s), correct syntax and indentation in your answer.

The answer grid contains vertical lines to help you indent your code accurately.

[8 marks]

Hints

You can uncover a set of hints below.

With a pencil and some paper. Really: try and do this by hand first. That way when you try it in Python the syntax errors will get picked up and you'll learn from your mistakes. Lots of people find writing code by hand difficult. The only way to learn is to do it.
This is the last question on the exam paper, so is probably the most complex problem. But you can still get marks by doing the bits you can do, even if you can't do it all. Some things to note:
  • follow the list of things the program should do through in order. If you don't know how to do part of it, leave a big gap and come back to it. If you really can't figure out how to do it, just write something like "code to calculate the distance goes here" so that the examiner can see the flow of your program
  • there are marks for getting data input, using variables and converting inputs to the right data type. I have a page about how to input (and output) values if you need it
  • data entered in Python always comes in as a string. You need to convert it – this is worth marks (see the link above)
  • there are marks for the calculation – so a mark for dividing something by five in the right sort of place
  • there is a mark for outputting the final value, so long as you do it in "a logically correct place" (that means "at the end" – see my point about leaving a big gap and writing what would happen in that section if necessary
You'll need some indefinite iteration I imagine. There's no need to do anything super fancy with it – no need for an error message even. The more bells and whistles you add in, the more likely you are to make an error.

Note that question 16 on the exam paper pretty much gives the answer away for how to do this part. It would be worth looking at it...

I might get around to putting up a solution and a markgrid at some point, but I'm not going to do that yet. Some people might know where the markschemes are anyway. That's fine – but I'd try and do the task first
You don't need it. Just use a piece of paper and make sure your indents are clear

Suggested Test Data:

Because no validation is required, you could enter any values. I don't think you need to make this too complicated, so start with just integers as the data entry values. I'd suggest the following as simple tests:

Test type Test data Expected result
Normal data Speed: 30
Wet: no
6 – tests a standard value with not wet ground – anything other than yes could be entered here
Normal data Speed: 30
Wet: yes
9 – tests a standard value with wet ground
Normal data Speed: 15
Wet: yes
11.25 – tests a standard value which creates a real number output
Boundary data Speed: 10
Wet: yes
3 – this is expected data but with the lowest value possible for speed
Boundary data Speed: 50
Wet: Yes
25 – this is expected data but with the highest value possible for speed. It also tests whether Yes is handled properly – the question specifically references to expect an input of yes for wet ground
Boundary data Speed: 9 Ask for input again – this is a value immediately outside the accepted range and should be rejected
Boundary data Speed: 51 Ask for input again – this is a value immediately outside the accepted range and should be rejected

You could also test other values for speed that are far outside the expected range (0, -25, 78 etc...) and also real numbers – there's no need to deal with these, but you could do if you chose to.

A note about copyright

The question text has been published openly on the web by AQA. That is copyrighted to them. The other words on this page are mine.

I'm using this here because the children I teach need to work on how they write exam answers – and the groups I published them for originally were cohorts massively impacted by COVID. I think, given that the questions have been published openly, that there is a fair-use educational rationale for putting them up here.

Note that I'm not putting them in a book, selling them on the TES, gaining any advertising revenue, or being paid in any other way for running this website. But I am aware that I'm in a copyright grey area. If that's a problem, contact me.