Question 6

AQA Computer Science June 2017 Paper 1A level6 marks

On the specification

6.1
4.2 Fundamentals of data structures
6.2
3.1 Fundamentals of programming
Question text

6 Two frequently completed actions when using a particular piece of software are undo and repeat. The undo action results in the state changing from the current state to the state previous to the user’s most recent action, eg if the last action the user completed was to change the font of a selected piece of text from Courier New to Chiller then if the undo action is selected the result will be to change the font of that text back to Courier New. The user is able to keep using the undo action to go back through all previous states. The repeat action results in the user’s most recent action being applied again, eg if the last action the user completed was to change the font of a piece of text to Chiller then if the repeat action is selected the result will be to change the font of the currently selected text to Chiller. The user is able to keep using the repeat action to apply the most recent action multiple times. The repeat action will only work when there is a most recent action that can be applied again. 6.1 Explain how a single stack can be used in the implementation of the repeat action and the undo action. [5 marks] 6.2 State the type of error that occurs if the user tries to complete an undo action before they have completed any other actions. [1 mark] You are advised to spend no more than 20 minutes on this section. Enter your answers to Section B in your Electronic Answer Document. You must save this document at regular intervals. The question in this section asks you to write program code starting from a new program/project/file. You are advised to save your program at regular intervals.