A-level Computing/AQA/Paper 1/Skeleton program/2022

This is for the AQA A Level Computer Science Specification.

This is where suggestions can be made about what some of the questions might be and how we can solve them.

Please be respectful and do not vandalise the page, as this would affect students' preparation for exams! Please do not discuss questions on this page. Instead use the discussion page.

Section C Predictions
The 2022 paper 1 will contain 5 questions worth 17 marks. As long as you know the program well, this will be a walk in the park.

06. This question is about the Breakthrough class.

06.1 State the name of a Boolean attribute in the Breakthrough class. [1 mark]

06.2 State the name of a method in the Breakthrough class that uses exception handling. [1 mark]

06.3 With reference to the CreateStandardDeck and AddDifficultyCardsToDeck methods and the "game1.txt" file - how many cards in total are in the deck? [1 mark]

06.4 With reference to the "game1.txt" saved game file, state what each line of the saved game file represents. [2 marks]

07. This question is about the method __Loadlocks in the Breakthrough class.

07.1 State the datatype used for __Locks. [1 mark]

07.2 State a correctly formatted single line which could be added to the "locks.txt" file to represent a 3-challenge lock needing an Acute Pick, Basic File and a Crude Key to open it. [1 mark]

08. This question is about the CreateStandardDeck and AddDifficultyCardsToDeck methods in the Breakthrough class.

08.1 State the type of iteration used. [1 mark]

08.2 State how many difficulty cards are generated when the game is run.

08.3 State how many other cards are generated when the game is run.

08.4 If we wished to make the game less difficult (reducing the number of difficulty cards from five to three), describe the necessary code changes which would need to be made assuming we wanted to keep the overall total number of cards the same.

These predictions are made based on last year's Advanced Subsidiary paper
 * Question about a class?
 * Question about a second class?
 * Question about a third class?
 * Question about a class diagram?
 * Question about a game functionality such as how to tell if game is ended?
 * Question about why text files were used over other file types to store data?

Section D Predictions
Programming Questions on Skeleton Program
 * The 2022 paper 1 contains 4 questions: a 5 mark, a 9 mark question, a 10 mark question and one 13 mark question - these marks include the screen capture(s), so the likely marks for the coding will be 1-2 marks lower.
 * The 2021 paper 1 contained ...
 * The 2020 paper 1 contained 4 questions: a 6 mark, an 8 mark question, a 11 mark question and one 12 mark question - these marks include the screen capture(s), so the likely marks for the coding will be 1-2 marks lower.
 * The 2019 paper 1 contained 4 questions: a 5 mark, an 8 mark question, a 9 mark question and one 13 mark question - these marks include the screen capture(s), so the marks for the coding will be 1-2 marks lower.
 * The 2018 paper 1 contained one 2 mark question, a 5 mark question, two 9 mark questions, and one 12 mark question - these marks include the screen capture(s).
 * The 2017 paper 1 contained a 5 mark question, three 6 mark questions, and one 12 mark question.

Current questions are speculation by contributors to this page.

Fix Key 1-5.
Fix "IndexOutOfRange" exception caused by inputting a card number not in the range 1 to 5.

This handles characters and out of range integers entered.

Add Load Function
Add functionality to select (load) a specific (saved) game file (currently no choice is given).

Require player to complete challenges in order
Currently the challenges for a lock do not need to be completed in order. Change the functionality to only allow the user to complete challenges for a lock in the order they are listed.

Public Overridable Function CheckIfConditionMet(ByVal Sequence As String) As Boolean For Each C In Challenges If Not C.GetMet Then If Sequence = ConvertConditionToString(C.GetCondition) Then C.SetMet(True) Return True Else Return False End If               End If            Next Return False End Function

Difficulty card functionality
At the moment a difficulty card will give the user the option to discard 5 cards OR discard a key by selecting it using 1-5. Change the functionality to force the user to select a key to discard OR if no keys are in the players hand then discard 5 cards from the deck.

Difficulty error
When given a difficulty card, the program will ask for either a 1-5 input or discard 5 deck cards. When a Key is selected it will not always discard it because the list index changes itself.

' New DifficultyCard Class Process subroutine

Retrieve card
Create a new card child class for a Retrieve card. If a player draws a retrieve card they are able to retrieve one card from the discard pile and return it to their hand. There should be two retrieve cards in the deck. These should be added, like the difficulty cards, after the user draws their hand.

Get card from deck class:

Must also add a call from the __SetUpGame function

In order to complete this challenge you need to create a new class called something like RetrievalCard, you need to alter the play game function, you need to alter the setupGame subroutine and you need to create a function to add retrieval cards to the deck. We will look at the Retrieval card class first, then the add retrieval cards function, then the altered setup game subroutine, then the play game function It is worth noting that only the code in the case "U" block has been changed for the playGame subroutine.

Card count
A player loses if they run out of cards in the deck without solving the locks. Therefore they may wish to see this information. Change the program so that alongside the current score the game also displays the number of cards remaining in the deck on each turn.

Save game
There is a load game feature but no ability to save the state of a game. Create one that can be called instead of View Discard or Use Card and saves the game to a file of the users choosing. Also change the Load Game functionality so that the user can enter the name of the file they want to load.

Add a case S into playGame: And change getChoice:

New saveGame

Add a method to CardCollection: Add a method to Lock:

'Create a new SaveGame method in Breakthrough class and modify the switch statement in PlayGame as well as update the SetupGame method in Breakthrough class to allow specific files to be chosen' 'Then in the Lock class do:'

'Footnote: In theory, it does not really matter what you call the methods. It is simplest to name them as appropriate as possible as per the zen of coding, but if it helps not to follow the standard for this then it doesn't really matter for the exam.'

Speciality deck
Currently the game provides a preset set of cards - picks, files and keys. Create a new method to create a SpecialityDeck for an alternative version of the game so the user/player can be provided with an option to play the StandardDeck *or* a SpecialityDeck. SpecialityDeck consists of three types of tool (E)xplosive, (W)elder and (A)nother.

Wild card
Currently the game provides a preset deck of cards. Add functionality for a 'wild card' which can be played against *any* particular lock.

Changes to code:

Consecutive Tool Type Penalty
Currently no error message is displayed if the user attempts to play two consecutive cards of the same tool type. Change the code to notify the user when their card has been disallowed due to this rule. In addition, leverage a score penalty of 1 point (reduce the user's score by one) and notify the user that this has occurred in all cases except where the user's score would then become negative in which case it should be omitted.

def __PlayCardToSequence(self, CardChoice): if self.__Sequence.GetNumberOfCards > 0: if self.__Hand.GetCardDescriptionAt(CardChoice - 1)[0] != self.__Sequence.GetCardDescriptionAt(self.__Sequence.GetNumberOfCards - 1)[0]: self.__Score += self.__MoveCard(self.__Hand, self.__Sequence, self.__Hand.GetCardNumberAt(CardChoice - 1)) self.__GetCardFromDeck(CardChoice) else: print("You are not allowed to play two consecutive moves with the same key") if self.__Score > 0: print("There's a 1 point penalty for not adhering to the rule") self.__Score = self.__Score - 1

See remaining Cards in the deck
Shows the list of remaining cards within the deck (kind of ruins the game but it could get asked)

-Riddlesdown Collegiate

Never reuse locks
When a lock is completed a new lock is selected from the list of locks at random. However, it could select a lock that has already been solved by the player. Adjust the method GetRandomLock in the breakthrough class to fix this.

private Lock GetRandomLock {       Lock NewLock; do           NewLock = Locks[RNoGen.Next(0, Locks.Count)]; while (!NewLock.GetLockSolved); return NewLock; }

Post Inspection of Discard Pile
When playing the game, the player can choose to inspect the discard pile by entering a "D" at their first input. The program is to be amended so that the player can choose to retrieve ONE card from the discard pile and discard ONE card from their hand. The card being retrieved cannot be a difficulty card.

Amend the method PlayGame from the Breakthrough class so that after the user chooses to inspect the discard pile: •	the user is prompted to enter a card number to retrieve from the discard pile by entering an integer value for the card. Entering 0 will skip this step. The user should be given the following prompt: "Please enter a number greater than 0 for a card to retrieve. Enter 0 if you wish to skip this step" •	the user is then asked to enter a number for the card that they wish to remove from their hand. The user should be given the following prompt: "Please enter a number for the card to discard from your hand" •	the cards are transferred between the discard pile and the hand and the game continues