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

This page is up to date for the new AQA 8525 syllabus for the 2022 exam. Make sure you check the revision pages to see which topics will be on the 2022 exam.

Programming Exam Question - Lowercase character checker

This is a seven mark paper 1 programming question. It was question 8 on the specimen exam paper and is, I think, quite hard to get your head around.

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 inputs a character and checks to see if it is lowercase or not.

Your program should work as follows:

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.

[7 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 well into the exam paper so the questions are getting quite tricky. But you can get marks for doing simple stuff.:
  • there are two marks for letting the user enter a character and storing it in a variable. I have a page about how to input (and output) values if you need it
  • you will need to use selection - if you construct this properly you'll get a mark even if your logic is wrong
  • there is a mark for outputting the two outputs - but you must spell the words correctly!
  • there's a mark for using a meaningful variable name even if you get the program very wrong indeed
Honestly, you can get most of the marks here for things that were in question 6 - and that are shown on the exam paper in other code snippets. You really don't need to know how to do the main task involved in the question to get 5 or 6 marks...
Yes, it is hard. I think there are at least three ways to do this, two of which involve using methods.

But you might not know that:

  • You can use > and < on strings as well as on numeric values
That's all I'll tell you for now...
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 value, including a string longer than one character But I don't think you need to test that really. I'd suggest the following as simple tests:

Test type Test data Expected result
Normal data y LOWER - this is an expected value and a lowercase character
Normal data Q NOT LOWER - this is an expected value but not a lowercase character
Normal data & NOT LOWER - this is not a lowercase character
Boundary data NOT LOWER - this is testing an empty string, which is always a good idea to test as odd things can happen

Note that data entry such as flimsy will almost certainly return LOWER. This is partly because of the way that Python handles strings and characters as the same thing (in C# or VB.Net they are handled as different data types).

A way to deal with this would be to make sure that the user only entered a single character. You could do this by checking the length of the string they entered - this would also deal with the empty string entry. But there's absolutely no need to do this in an exam.

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 are a cohort 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 or 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.