Prelim 2025 code

    Cards (277)

    • What type of list is used to store allowed numbers?
      List<int>
    • What is the maximum number of targets allowed in the game?
      20
    • What does the user input "y" signify in the program?
      To play the training game
    • What are the maximum values for MaxNumber and MaxTarget in the training game?
      Both are 1000
    • What is the initial list of targets in the training game?
      { -1, -1, -1, -1, -1, 23, 9, 140, 82, 121, 34, 45, 68, 75, 34, 23, 119, 43, 23, 119 }
    • What happens if the user input is valid?
      It converts to RPN and checks numbers
    • How does the program determine if the user input evaluation is a target?
      By checking against the Targets list
    • What does the method RemoveNumbersUsed do?
      Removes numbers used from NumbersAllowed
    • What is the purpose of the UpdateTargets method?

      To shift targets and add a new one
    • What does the CheckValidNumber method validate?
      If a number is within the valid range
    • What does the DisplayState method show?
      Current targets, allowed numbers, and score
    • What is the format of the user input expected by CheckIfUserInputValid?
      Regular expression for valid expressions
    • What does the GetTarget method do?
      Generates a random target number
    • How many targets are initialized to -1 in CreateTargets?
      5
    • What does the FillNumbers method do in the training game?
      Returns a fixed list of numbers
    • What are the main components of the PlayGame method?
      • Displays current state
      • Accepts user input
      • Validates input
      • Evaluates input against targets
      • Updates score and targets
    • What are the steps involved in converting user input to RPN?
      1. Initialize position and precedence
      2. Extract operands and operators
      3. Apply operator precedence rules
      4. Build RPN expression
    • What are the rules for evaluating RPN expressions?
      • Use a stack to hold operands
      • Apply operators to the top two operands
      • Push the result back onto the stack
      • Return -1 for non-integer results
    • What are the key features of the CheckNumbersUsedAreAllInNumbersAllowed method?
      • Checks if all used numbers are allowed
      • Compares user input with allowed numbers
      • Returns true if all are valid
    • What is the significance of the Score variable in the game?
      • Tracks the player's score
      • Increases when a target is hit
      • Decreases for invalid inputs
    • What is the role of the EvaluateRPN method?
      • Evaluates the RPN expression
      • Returns the result or -1 for errors
      • Uses a stack for calculations
    • What are the conditions for game over in the PlayGame method?
      • All targets are hit
      • User input is invalid
      • Score reaches a certain limit
    • What is the purpose of the DisplayTargets method?
      • Shows current targets in the game
      • Indicates which targets are hit
      • Formats output for clarity
    • What does the GetNumberFromUserInput method do?
      • Extracts numbers from user input
      • Advances position in the input string
      • Returns -1 if no number is found
    • What is the purpose of the Regex class in the program?
      • Validates user input format
      • Matches patterns in strings
      • Ensures correct number formats
    • What is the significance of the Random class in the program?
      • Generates random numbers for targets
      • Ensures unpredictability in the game
      • Used for both allowed numbers and targets
    • What are the main types of games available in the program?
      • Training game
      • Random game
    • What is the role of the Console class in the program?
      • Handles user input and output
      • Displays game state and score
      • Reads user commands
    • What are the key components of the program's structure?
      • Main method
      • Game logic methods
      • Input validation methods
      • Display methods
    • What is the significance of the internal class in the program?
      • Encapsulates program logic
      • Restricts access to the class
      • Organizes code for clarity
    • What is the purpose of the List class in the program?
      • Stores dynamic collections of data
      • Allows easy manipulation of elements
      • Used for targets and allowed numbers
    • What is the significance of the static keyword in the program?
      • Indicates class-level methods and variables
      • Allows access without creating an instance
      • Used for utility functions
    • What is the purpose of the namespace in the program?
      • Organizes code into logical groups
      • Prevents naming conflicts
      • Enhances code readability
    • What is the role of the Dictionary class in the program?
      • Stores key-value pairs for operator precedence
      • Allows fast lookups of operator priorities
      • Used in RPN conversion logic
    • What is the significance of the Console.WriteLine method?
      • Outputs text to the console
      • Displays game information and prompts
      • Used for user interaction
    • What is the purpose of the List<int> type in the program?
      • Stores integers for targets and allowed numbers
      • Provides dynamic resizing capabilities
      • Facilitates easy data manipulation
    • What is the significance of the Main method in the program?
      • Entry point for the application
      • Initializes game variables and starts the game
      • Controls the flow of the program
    • What is the purpose of the Skeleton Program code?
      To facilitate the AQA A Level Paper 1 exam
    • What programming environment is used for the code?
      Visual Studio Community Edition
    • What is the maximum number of targets allowed in the game?
      20
    See similar decks