Question 7

AQA Computer Science June 2024 Paper 1 (7517/1)A level13 marks

On the specification

7.1
3.1 Fundamentals of programming3.3 Systematic approach to problem solving
7.2
3.3 Systematic approach to problem solving
Question text

7 Write a program that gets the user to enter an integer. It should keep doing this until they enter a value greater than 0. The program should then tell the user if they have entered a perfectly bouncy number, a bouncy number or a number that is not bouncy. A bouncy number is a number that is not an increasing number and not a decreasing number. An increasing number is one where each digit is greater than or equal to the previous digit in the number. A decreasing number is one where each digit is less than or equal to the previous digit in the number. A perfectly bouncy number is a bouncy number in which the number of digits that are followed by a larger digit is equal to the number of digits that are followed by a smaller digit. Examples • 13578 is not a bouncy number because it is an increasing number. • 973 is not a bouncy number because it is a decreasing number. • 98657 is a bouncy number. • 1111 is not a bouncy number because it is both an increasing number and a decreasing number. • 13421 is a perfectly bouncy number as exactly two digits are followed by a larger digit and there are also exactly two digits followed by a smaller digit. • 1829361 is a perfectly bouncy number as exactly three digits are followed by a larger digit and there are also exactly three digits followed by a smaller digit. • 13333331 is a perfectly bouncy number as there is exactly one digit followed by a larger digit and also exactly one digit followed by a smaller digit. Evidence that you need to provide Include the following evidence in your Electronic Answer Document. 7.1 Your PROGRAM SOURCE CODE [12 marks] 7.2 SCREEN CAPTURE(S) showing the results of testing the program by entering the integers: • –3 • 14982 • 1234 You will need to execute your program more than once to test all of the integers. [1 mark] You are advised to spend no more than 20 minutes on this section. Enter your answers to Section C in your Electronic Answer Document. You must save this document at regular intervals. These questions refer to the Preliminary Material and the Skeleton Program, but do not require any additional programming. Refer either to the Preliminary Material issued with this question paper or your electronic copy.