Save
Computer Science
Prelim 2025 code
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Nina Correia
Visit profile
Cards (277)
What type of list is used to store allowed numbers?
List<
int
>
View source
What is the maximum number of targets allowed in the game?
20
View source
What does the user input "y" signify in the program?
To
play
the
training
game
View source
What are the maximum values for MaxNumber and MaxTarget in the training game?
Both are
1000
View source
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 }
View source
What happens if the user input is valid?
It converts to
RPN
and checks
numbers
View source
How does the program determine if the user input evaluation is a target?
By checking against the
Targets
list
View source
What does the method RemoveNumbersUsed do?
Removes numbers used from
NumbersAllowed
View source
What is the purpose of the
UpdateTargets
method
?
To shift targets and add a new one
View source
What does the CheckValidNumber method validate?
If a number is within the
valid range
View source
What does the DisplayState method show?
Current
targets
, allowed
numbers
, and
score
View source
What is the format of the user input expected by CheckIfUserInputValid?
Regular expression
for valid expressions
View source
What does the GetTarget method do?
Generates a random target number
View source
How many targets are initialized to -1 in CreateTargets?
5
View source
What does the FillNumbers method do in the training game?
Returns a
fixed list
of numbers
View source
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
View source
What are the steps involved in converting user input to RPN?
Initialize position and precedence
Extract
operands
and operators
Apply
operator precedence rules
Build RPN expression
View source
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
View source
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
View source
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
View source
What is the role of the EvaluateRPN method?
Evaluates the RPN expression
Returns the
result
or -1 for errors
Uses a
stack
for calculations
View source
What are the conditions for game over in the PlayGame method?
All
targets
are hit
User input is
invalid
Score reaches a certain limit
View source
What is the purpose of the DisplayTargets method?
Shows current targets
in the
game
Indicates which targets are hit
Formats
output
for
clarity
View source
What does the GetNumberFromUserInput method do?
Extracts numbers from user input
Advances
position in the input string
Returns -1 if no number is found
View source
What is the purpose of the Regex class in the program?
Validates
user input
format
Matches
patterns
in strings
Ensures correct
number formats
View source
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
View source
What are the main types of games available in the program?
Training game
Random game
View source
What is the role of the Console class in the program?
Handles
user input
and output
Displays
game state
and
score
Reads user commands
View source
What are the key components of the program's structure?
Main method
Game logic methods
Input validation methods
Display methods
View source
What is the significance of the internal class in the program?
Encapsulates
program logic
Restricts
access to the class
Organizes code for
clarity
View source
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
View source
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
View source
What is the purpose of the namespace in the program?
Organizes code into logical groups
Prevents
naming conflicts
Enhances code readability
View source
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
View source
What is the significance of the Console.WriteLine method?
Outputs
text
to the console
Displays
game information
and prompts
Used for user interaction
View source
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
View source
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
View source
What is the purpose of the Skeleton Program code?
To facilitate the
AQA
A Level Paper 1
exam
View source
What programming environment is used for the code?
Visual Studio Community Edition
View source
What is the maximum number of targets allowed in the game?
20
View source
See all 277 cards
See similar decks
AP Computer Science Principles
1196 cards
OCR GCSE Computer Science
1937 cards
AP Computer Science A
1898 cards
AQA A-Level Computer Science
5135 cards
Edexcel GCSE Computer Science
2949 cards
AQA GCSE Computer Science
2308 cards
1.6.2 Legislation Relevant to Computer Science
OCR GCSE Computer Science > 1.6 Ethical, Legal, Cultural and Environmental Impacts of Digital Technology
39 cards
OCR A-Level Computer Science
2091 cards
Topic 3: Computers
Edexcel GCSE Computer Science
454 cards
3.2.3 Translating high-level code:
Edexcel GCSE Computer Science > Topic 3: Computers > 3.2 Characteristics of Programming Languages
39 cards
3.4 Computer systems
AQA GCSE Computer Science
208 cards
13.3.1 Writing code
AQA A-Level Computer Science > 13.0 Systematic approach to problem solving > 13.3 Implementation
81 cards
3.1 Hardware and Software Components
Edexcel GCSE Computer Science > Topic 3: Computers
310 cards
3.5 Fundamentals of computer networks
AQA GCSE Computer Science
218 cards
3.1.2 Understanding computer software:
Edexcel GCSE Computer Science > Topic 3: Computers > 3.1 Hardware and Software Components
47 cards
2.1 Algorithms
OCR GCSE Computer Science
207 cards
6.4 Computer architecture
AQA A-Level Computer Science > 6.0 Fundamentals of computer systems
37 cards
4.2.3 Environmental Science
AP French Language and Culture > Unit 4: How Science and Technology Affect Our Lives > 4.2 Science and Ethics
59 cards
6.0 Fundamentals of computer systems
AQA A-Level Computer Science
254 cards
3.4.2 Boolean logic
AQA GCSE Computer Science > 3.4 Computer systems
54 cards
1.5 Systems Software
OCR GCSE Computer Science
59 cards