AP CSP Practice Exam Overview
Apr 3, 2026
All files
AP Computer Science Principles Create Performance Task Scoring Commentaries (2021 Rubrics)
This document provides scoring commentaries for the AP Computer Science Principles Create Performance Task, applying the 2021 rubrics to pilot student responses. It details how student projects were evaluated based on specific criteria, with examples from various student submissions.
Sample A: Language Translator (6/6 Points)
This response successfully earned full points by meeting all criteria across the evaluated sections.
-
Program Purpose and Functionality:
- The program's purpose is to aid in learning new languages by translating color names.
- Functionality demonstrated includes receiving user color selection in French and Spanish and outputting the audio pronunciation of the color in the selected language.
- Input: User selects a language (Spanish or French) and taps on a color.
- Output: Audio pronunciation of the color in the selected language.
-
Data Storage and Use (Lists):
- Two code segments show data stored in a list named
Audioand its use for processing output. - The
Audiolist stores color names in English, used to generate corresponding Spanish or French audio files. - Managing Complexity: The list
Audiomanages complexity by enabling the program to dynamically create audio filenames based on the selected language and color index. Without lists, each color-language combination would require individual buttons and more complex code.
- Two code segments show data stored in a list named
-
Procedures and Algorithms:
- A student-developed procedure
ButtonClickedwith a parameterindexwas used. - Purpose of
ButtonClicked: Selects the correct audio file based on language and color selection, contributing to program efficiency by centralizing code. - Algorithm within
ButtonClicked: Includes sequencing, selection (if statement), and iteration (while loop).- It takes the color's index, retrieves the English color name from the
Audiolist, appends a language identifier (e.g., '-spanish'), and adds '.mp3' to create the audio filename. - Iteration is used when no or both languages are selected, repeating an audio prompt.
- It takes the color's index, retrieves the English color name from the
- Testing Procedures: Two calls to
ButtonClickedwere described: one for Spanish (color orange) and one for French (color orange), testing the correct translation output for each language.
- A student-developed procedure
Sample B: Typing Game (5/6 Points)
This response earned 5 out of 6 points, missing one criterion.
-
Program Purpose and Functionality:
- Purpose: A computer game to practice typing skills.
- Functionality: Users input phrases, earn points, and receive penalties for errors.
- Input: Typing a sentence.
- Output: Score updates, timer restarts upon correct input, or a penalty on the timer and a notification upon incorrect input.
-
Data Storage and Use (Lists):
- Code segments show initialization and use of
highScoreListto maintain top player scores. highScoreListstores data from previous players.- Managing Complexity:
highScoreListmanages complexity by allowing easy sorting and resaving of high scores. Without it, managing an unknown number of variables for new high scores would be difficult.
- Code segments show initialization and use of
-
Procedures and Algorithms:
- The response did not earn the point for procedures and algorithms.
- While a procedure
ButtonClickedwas mentioned, the scoring commentary focused on the first provided procedure (procedurerunclockin Sample E's context, though not explicitly detailed for Sample B's missing point). - The
procedurerunclock(hypothetically, as it was not fully detailed for Sample B's missing point) included sequencing and selection but lacked iteration. - The explanation focused on
proceduredisplayclockrather than the required procedure with a parameter. - No test cases for a procedure with parameters were provided.
Sample E: Screen Limiter (3/6 Points)
This response earned 3 out of 6 points.
-
Program Purpose and Functionality:
- Purpose: To address screen addiction by making users conscious of their usage.
- Functionality: Times screen usage, suggests alternative activities via an "activities button."
- Input: Amount of time spent on screen daily.
- Output: Screen-free challenge time, suggested activities.
-
Data Storage and Use (Lists):
- Code segments show data stored in a list named
activityand its use for suggesting activities. activitystores alternatives to screen usage and screen-free challenge times.- Managing Complexity: The
activitylist organizes data in one location, avoiding the need for numerous buttons to display different activities.
- Code segments show data stored in a list named
-
Procedures and Algorithms:
- The response did not earn points for procedures and algorithms.
- The
procedurerunclockprocedure used a parametertimeand was called byproceduredisplayclock. - However, the description of
procedurerunclockwas missing. - The
procedurerunclockalgorithm included sequencing and selection but lacked iteration. - The explanation focused on
proceduredisplayclock, notprocedurerunclock. - Test cases were related to other program aspects, not
procedurerunclock.
Sample F: Darts Game (3/6 Points)
This response earned 3 out of 6 points.
-
Program Purpose and Functionality:
- Purpose: To entertain children with multiple games.
- Functionality: Gameplay involves entering a username, throwing darts, scoring, and displaying high scores.
- Input: Username, dart throw location.
- Output: Score per dart, high score list.
-
Data Storage and Use (Lists):
- Code segments show data stored in
ScoresandHighScoreslists, withHighScoresusingScoresto identify the top player. Scoresstores integer scores.- Managing Complexity: The response claimed
Scoresreduces lines of code by avoiding repeated display, but it did not adequately explain how the list manages complexity or how the program would be more complex without it. The provided code could achieve similar results with individual variables.
- Code segments show data stored in
-
Procedures and Algorithms:
- The response did not earn the point for procedures.
- The
backdrop_switchesevent was a built-in event, not a student-developed procedure with a parameter. - While the event's function was described (throwing a dart, scoring based on color), no procedure with a parameter was used.
- The response did not earn the point for algorithms.
- A student-developed algorithm was present, including sequencing, selection, and iteration (forever loop).
- The explanation detailed how the algorithm works: throwing a dart randomly, scoring based on color, managing remaining darts, and assigning scores based on color contact.
- The response did not earn the point for testing procedures.
- The description provided paths based on user input during execution, not two distinct calls to a procedure with different arguments.
Sample G: RPG Character (2/6 Points)
This response earned 2 out of 6 points.
-
Program Purpose and Functionality:
- Purpose: To simplify the creation of RPG characters with customizability.
- Functionality: The video demonstrated collecting input for RPG character creation questions.
- Input: Answers to character creation questions.
- Output: Displayed RPG questions and prompts.
- The response did not fully describe functionality or input/output.
-
Data Storage and Use (Lists):
- Code segments show the
statslist initialized and used in theStatRollprocedure. statsstores player character attributes (Strength, Intelligence, etc.).- Managing Complexity: The
statslist centralizes character attributes, making them easy to modify and export. Without it, each stat would be a separate variable, complicating management and export.
- Code segments show the
-
Procedures and Algorithms:
- The response did not earn the point for procedures.
- The code segment provided in 3c was not a student-developed procedure. The student-developed procedure with a parameter in 3b could not be used for scoring 3c.
- The response earned the point for algorithms.
- The
hasSpaceInStringprocedure was student-developed, used a parameterstr, and was called within code for saving a player's name. - Purpose of
hasSpaceInString: Checks for spaces in a name using iteration, contributing to managing user input for score names. - The response earned the point for testing procedures.
- Two calls to
hasSpaceInStringwith different arguments ("Mr Guy", "Mr.Clean") were described, testing conditions for the presence or absence of a space and their resulting true/false outcomes. - The response did not earn the point for algorithms.
- The
hasSpaceInStringalgorithm included sequencing, selection, and iteration (for loop). - However, the explanation of the algorithm lacked sufficient detail for recreation.
Sample C: Global Warming (4/6 Points)
This response earned 4 out of 6 points.
-
Program Purpose and Functionality:
- Purpose: To lessen global warming effects and reduce non-recyclable waste.
- Functionality: Displays random "global questions," processes user answers, and provides feedback (statement, thumbs-up/down).
- Input: User answers to questions via a textbox.
- Output: Statements from "global solutions list," visual feedback (thumbs-up/down).
-
Data Storage and Use (Lists):
- Code segments show initialization of
solution_listandquestion_list, and their use in processing user responses. question_liststores the questions displayed to the user.- The response did not earn the point for managing complexity.
- The
question_listwas used to replace hard-coded question strings in if statements, but list access and processing were hard-coded by index, making it difficult to maintain and scale. The explanation of managing complexity was insufficient.
- Code segments show initialization of
-
Procedures and Algorithms:
- The response earned the point for procedures.
- The
interpret_responseprocedure used a parameternumber_of_hoursand was called by theFind_Response_button.Clickevent. - Purpose of
interpret_response: Processes "number of hours" and selects an output from thesolution_listbased on the question and hours, using a loop to analyze the displayed question. - The response did not earn the point for algorithms.
- The
interpret_responsealgorithm included sequencing, selection, and iteration, but the iteration was trivial as the outcome was the same regardless of iteration count. - The explanation of the algorithm's sequence was provided, detailing how it checks the question and "number of hours" to select strings from the
solutions_listand set an image property. - The response earned the point for testing procedures.
- Two calls to
interpret_responsewere described: one for AC usage ("6 hours") and one for driving time ("1 hour"). - Conditions tested whether AC usage was too high or fossil fuel emissions were low.
- Results described the appropriate user feedback and alternatives offered.
Sample D: Air Hockey (4/6 Points)
This response earned 4 out of 6 points.
-
Program Purpose and Functionality:
- Purpose: To provide entertainment for solitary players.
- Functionality: A digital air hockey game where users move paddles to score.
- Input: Mouse location (x, y coordinates) to control paddles.
- Output: Visible game interface, increasing score.
-
Data Storage and Use (Lists):
- A code segment shows data stored in the
scoreslist based on puck location. scoresstores the scores for the left and right players in its first and second indices.- The response did not earn the point for managing complexity.
- The
scoreslist did not manage complexity, as the same result could be achieved with two variables. The explanation that using variables would be more difficult was not substantiated.
- A code segment shows data stored in the
-
Procedures and Algorithms:
- The response earned the point for procedures.
- The
lpyprocedure received a parameteryand was called. - Purpose of
lpy: Limits the left paddle's movement to the left side of the screen by holding the mouse's y-intercept. - The response did not earn the point for algorithms.
- The algorithm included sequencing and selection but lacked iteration.
- The explanation of the algorithm was detailed enough for recreation.
- The response earned the point for testing procedures.
- Two calls to
lpywere described based on the mouse's y-position relative to 40 and 50. - Conditions tested whether the y-position met requirements.
- Results described whether the paddle would move or not based on the condition.
- The response did not earn the point for algorithms.
- An algorithm with sequencing, selection (if/elif), and iteration (while loop) was present but not within a procedure with a parameter.
- The loop was trivial (controlled by
looper1), and the explanation lacked sufficient detail for recreation.
Sample H: Water Safety (2/6 Points)
This response earned 2 out of 6 points.
-
Program Purpose and Functionality:
- Purpose: To help users identify if their water is safe for drinking or animals.
- Functionality: Identifies water safety.
- Input: User input via prompted questions.
- Output: Statements indicating water safety for drinking or animals.
-
Data Storage and Use (Lists):
- Code segments showed data stored in a list named
valuesand its use in processing responses. - The list was identified as
values. - The response did not describe what was stored in the
valueslist. - The response did not earn the point for managing complexity.
- The
valueslist held only one element, which could be stored in a single variable. The rationale provided did not demonstrate easier development, maintenance, or scaling.
- Code segments showed data stored in a list named
-
Procedures and Algorithms:
- The response did not earn the point for procedures.
- A student-developed algorithm was present but not within a procedure with a parameter.
- The description of the algorithm focused on adding user input to the list and testing nitrate levels, not on its detailed workings.
- The response earned the point for algorithms.
- The algorithm included sequencing, selection (try...except), and iteration (while loop).
- The explanation detailed how the algorithm adds user input to a list and handles non-integer input.
- The response did not earn the point for testing procedures.
- No procedure with parameters was provided, and user inputs described were not shown as parameters to a procedure.
Sample I: Random Numbers (2/6 Points)
This response earned 2 out of 6 points.
-
Program Purpose and Functionality:
- Purpose: To address the need for creating random numbers.
- Functionality: Produces a series of random integers based on user input.
- Input: An integer input.
- Output: Displaying the series of values (though the description lacked detail on output demonstration).
-
Data Storage and Use (Lists):
- A code segment shows data stored in a list named
listand generated within a procedure. liststores random integers.- The response did not earn the point for managing complexity.
- The list was irrelevant; random values could be printed as generated. The explanation that lists make generating multiple numbers easier was not convincing.
- A code segment shows data stored in a list named
-
Procedures and Algorithms:
- The response earned the point for procedures.
- The
genlistprocedure took a parameternand was called. - Purpose of
genlist: Consolidates random number generation into a function, returning a list of generated numbers. - The response did not earn the point for algorithms.
- The algorithm included sequencing, selection (if n < 2), and iteration (for loop).
- The description of what the algorithm does was provided, but not how it works for recreation.
- The response did not earn the point for testing procedures.
- Two calls to
genlistwith parameters 5 and 10 were described, resulting in lists of 5 and 10 random integers, respectively. However, these calls did not evoke different code segments within the algorithm as both parameters were greater than 1.
AP Computer Science Principles 2025 Free-Response Questions Summary
This document outlines the structure and content of the Free-Response Questions for the AP Computer Science Principles exam, specifically focusing on Set 2. These questions are designed to assess a student's understanding of their submitted Create Performance Task.
Exam Structure and Guidelines
- Section II: This section consists of 2 questions, totaling 4 written-response prompts.
- Time Allotment: Students have 60 minutes to complete Section II.
- Basis of Questions: All questions are based on the student's Create Performance Task.
- Personalized Project Reference: Students are instructed to refer to their Personalized Project Reference for specific code segments related to lists and procedures within their project.
- Scratch Paper: Allowed for notes and planning, but only responses entered within the application will be graded.
- Annotations: Text entered as annotations will not be considered part of the answer.
- Navigation: Students can move between questions within this section until time expires.
- Time Warning: The clock will turn red with 5 minutes remaining; no further verbal warnings will be given.
- Format Note: The exam is presented in a format optimized for classroom use, though it was originally administered digitally.
Question Breakdown and Key Areas of Assessment
The Free-Response Questions (Set 2) assess various aspects of a student's Create Performance Task, focusing on:
Question 1: Program Output and Functionality
- Task: Identify an example output of the student's program.
- Assessment: Explain how this specific output demonstrates a particular aspect of the program's functionality.
Question 1 (Alternative Prompt): Unexpected/Invalid Input
- Task: Identify an unexpected or invalid input a user might provide.
- Assessment: Describe the program's behavior upon receiving this input. If the program is designed to prevent such inputs, explain why.
Question 2: Code Analysis and Modification (Referencing Personalized Project Reference)
This question is divided into three parts (A, B, and C), each focusing on different code elements:
-
Part A: Selection Statements and Boolean Expressions
- Task: Identify the Boolean expression within the first selection statement in the Procedure section of the Personalized Project Reference.
- Assessment:
- Identify a specific value or set of values that will cause this expression to evaluate to true (or false in the alternative prompt).
- Explain why the specified value(s) lead to that specific evaluation (true or false).
-
Part B: Procedures and Logic Errors
- Task: Consider a specific procedure (identified in the Personalized Project Reference).
- Assessment:
- Describe a modification another programmer could make to this procedure that would introduce a logic error.
- Explain how the procedure's behavior would change due to this logic error.
-
Part C: Lists and Code Modification
- Task: Consider a specific list (identified in the List section of the Personalized Project Reference).
- Assessment:
- If new elements are added to the end of the list, explain how a related code segment (part (ii) of the List section) would need to be modified.
- If no modifications are necessary, explain why.
-
Part C (Alternative Prompt): Procedures and Maintainability
- Task: Consider a specific procedure (identified in the Personalized Project Reference).
- Assessment:
- Describe the functionality provided by this procedure.
- Explain how implementing this functionality as a procedure makes the program easier to maintain compared to not using a procedure.
AP Computer Science Principles Practice Exam and Notes Summary
This document provides a practice exam and supplementary notes for the AP Computer Science Principles exam, developed by the College Board. It outlines the purpose, structure, and administration of the exam, as well as the College Board's commitment to equity and access in AP programs.
Main Idea
The primary purpose of this document is to serve as a preparation tool for the AP Computer Science Principles exam. It offers a practice exam that mirrors the format and content of the actual exam, along with detailed notes explaining the rationale behind each question and its alignment with the AP Computer Science Principles curriculum framework.
Key Points and Details
1. Purpose and Usage of the Practice Exam:
- AP Exam Preparation: Provided by the College Board for students preparing for the AP Computer Science Principles exam.
- Classroom Use Only: Teachers can download and copy materials for classroom use.
- Security: All materials must be collected and kept secure after administration.
- Restrictions: Exams cannot be posted online or redistributed electronically to maintain exam security and fairness. Violations may lead to termination of access and penalties.
2. About the College Board:
- Mission-Driven Organization: Connects students to college success and opportunity.
- Founded in 1900: Created to expand access to higher education.
- Membership: Composed of over 6,000 leading educational institutions.
- Services: Helps over seven million students transition to college through programs like SAT® and Advanced Placement (AP®).
- Advocacy: Supports students, educators, and schools through research and advocacy.
- Website: www.collegeboard.org
3. AP® Equity and Access Policy:
- Encourages Equitable Access: All willing and academically prepared students should have the opportunity to participate in AP.
- Eliminate Barriers: Efforts should be made to remove barriers for underrepresented ethnic, racial, and socioeconomic groups.
- Diverse Classes: AP classes should reflect the diversity of the student population.
- Preparation: All students should have access to academically challenging coursework before AP classes to prepare them for success.
4. Exam Content and Format:
- Exam Structure: The AP Computer Science Principles assessment has two parts:
- Through-Course Assessment (40% of score): Consists of two performance tasks requiring digital artifact uploads via a web portal.
- End-of-Course Exam (60% of score): Consists of 74 multiple-choice questions. This practice exam is for the end-of-course exam only.
- Exam Length: 2 hours.
- Question Types:
- Single-select multiple-choice questions (select one answer).
- Multiple-select multiple-choice questions (select two answers).
- Stimulus Material: Questions may be accompanied by non-textual materials like diagrams or charts.
- Programming Reference: Programming reference materials are included in the exam booklet to help understand programming question formats and meanings, as no specific programming language is designated.
5. Development of AP Courses and Exams:
- Committee Design: Courses and exams are designed by committees of college faculty and AP teachers.
- Curriculum Framework: Committees define course scope, expectations, and learning objectives.
- Evidence-Centered Design: Exams are developed using an evidence-centered design approach, starting with end goals and defining observable performance evidence.
- Backward Design: Curricula, instruction, and assessments are developed with the end goal in mind.
- Multiyear Process: Exam development is a multiyear process involving extensive review, revision, piloting, and analysis.
- Feedback: Feedback from secondary and postsecondary educators is gathered throughout the development process.
6. Scoring of AP Exams:
- Multiple-Choice: Scored by machine.
- Performance Assessments: Scored by college faculty and expert AP teachers at the AP Reading.
- Scoring Process: Readers are trained, and their work is monitored for fairness and consistency. A Chief Reader oversees scoring standards.
- Composite Score: Weighted scores from multiple-choice and performance assessments are combined into a composite score, converted to an AP score of 1-5.
- Score Setting: Involves psychometric analyses and comparison with college-level standards. AP scores are generally equivalent to college grades (e.g., AP score of 5 is equivalent to an A in a comparable college course).
7. Administering the Practice Exam:
- Instructions: Detailed instructions are provided for administering the practice exam to simulate actual testing conditions.
- Time Limit: 2 hours for 74 multiple-choice questions.
- Scoring: Total score is based only on the number of questions answered correctly; no points are deducted for incorrect answers or unanswered questions.
- Reference Materials: Students should use the provided programming reference materials.
8. Programming Reference Materials:
- Data Types: Instructions use four data types: numbers, Booleans, strings, and lists.
- Categories of Instructions:
- Assignment, Display, and Input
- Arithmetic Operators and Numeric Procedures (including MOD and RANDOM)
- Relational and Boolean Operators (=, ≠, >, <, ≥, ≤, AND, OR, NOT)
- Conditional Execution (IF, IF/ELSE)
- Iteration (REPEAT, REPEAT UNTIL, FOR EACH)
- List Operations (accessing elements, assignment, INSERT, APPEND, REMOVE, LENGTH)
- Procedures (with or without RETURN values)
- Robot Commands (MOVE FORWARD, ROTATE LEFT, ROTATE RIGHT, CAN MOVE)
9. Notes on the Practice Exam:
- Curriculum Framework Alignment: This section explains how each practice question links to the AP Computer Science Principles curriculum framework (Enduring Understandings, Computational Thinking Practices, Essential Knowledge).
- Rationales: Provides explanations for correct and incorrect answer choices.
This practice exam and its accompanying notes are designed to provide a comprehensive and accurate representation of the AP Computer Science Principles exam, aiding both educators and students in their preparation.
Summary of Word Guessing Game Program
This document describes a word guessing game created on the code.org website, designed to help users recognize new words and expand their vocabulary. The game involves a user guessing letters to reveal a randomly generated word, with a limited number of lives.
Core Functionality
The game's primary function is to compare user input (letters) against a hidden word.
-
guessWords(letter)Function: This is the core logic for handling user guesses.- It initializes a boolean variable
checktofalseand a countercountto0. - It iterates through the individual letters of the
guessingWord(stored in theletOfGuessWordlist). - Letter Matching: If the
letterinput by the user matches a letter inletOfGuessWord, the following occurs:- The matched letter is displayed in its correct position on the screen (e.g.,
setText("let" + i, letter)). checkis set totrue.countis incremented to track correct guesses.
- The matched letter is displayed in its correct position on the screen (e.g.,
- Incorrect Guess Handling: After checking all letters, if
checkremainsfalse(meaning the guessed letter was not in the word):- A life is deducted from the user (
lives = lives - 1). - The displayed lives count is updated (
setText("livesCount", lives)).
- A life is deducted from the user (
- Game End Conditions:
- Losing: If
livesreaches0, the game ends, and the "losingScreen" is displayed, showing the correct word. - Winning: If
countequals the length of theguessingWord, all letters have been guessed correctly, and the "winningScreen" is displayed.
- Losing: If
- The function returns the
checkboolean, indicating if the guessed letter was found.
- It initializes a boolean variable
-
onEvent("textInp", "change", ...): This event handler is triggered when the user types into the input field (textInp).- It retrieves the user's input.
- It converts the input to lowercase using
.toLowerCase(). - It calls the
guessWords()function with the processed input. - It clears the input field (
setText("textInp", "")).
Data Structures and Initialization
getRandomWord()Function:- Initializes the lives display.
- Filters
allWordsto create a listwords5containing only words of length 5. - Selects a random word from
words5to be theguessingWord. letOfGuessWordList: This crucial list stores each individual letter of theguessingWordin separate indexes.- This is vital for efficient comparison and display of letters. Without it, the program would need multiple variables and more complex loops.
Game Variables
lives: Initialized to6, representing the number of attempts the user has.count: Initialized to0, tracks the number of correctly guessed letters.check: A boolean flag, initialized tofalsefor each guess, indicating if a correct letter was found in the current guess.
Example Scenarios (Test Cases)
The document provides specific examples to illustrate the guessWords function's behavior:
-
First Call Example:
- User Input:
1 - Guessing Word:
"hello" - Condition Tested (Line 49): The
ifstatement compares"1"to each letter in"hello". - Result:
false, because"1"is not found in"hello".
- User Input:
-
Second Call Example:
- User Input:
"h" - Guessing Word:
"hello" - Condition Tested (Line 49): The
ifstatement compares"h"to each letter in"hello". - Result:
true, because"h"is found in"hello".
- User Input:
Observed Game Behavior (from Video Description)
The accompanying video demonstrates various aspects of the game:
- Users input letters, numbers, symbols, and multiple characters.
- Correct guesses reveal the letter in its position (e.g.,
Pinput results inp_ _). - Incorrect guesses lead to a loss of a life.
- The game concludes with either a winning screen (all letters guessed) or a losing screen (ran out of lives).
Summary of the Fishing Game Program
This document outlines the functionality and mechanics of a simulated fishing game, focusing on its core purpose, player input, game elements, and the procedural logic for fish movement.
1. Overall Program Purpose and Gameplay
- Objective: To reduce boredom by simulating a timed fishing game that includes scorekeeping.
- Demonstrated Features:
- Boat movement controlled by player input.
- Hook mechanics: The hook moves down from the boat and returns to catch fish.
- Scorekeeping: Tracks the total score based on fish caught within the time limit.
- Detailed Scorekeeping: Tracks the quantity of each specific type of fish caught.
2. Player Input and Game Output
- Boat Movement:
- Input: Pressing the 'a' key moves the boat left.
- Input: Pressing the 'd' key moves the boat right.
- Hook Action:
- Input: Pressing the spacebar initiates the hook action.
- Output: A hook sprite moves downwards from beneath the boat and then returns. This action is designed to "catch" or touch other sprites (fish).
- End Game Output:
- When the time limit is reached, the game displays a message detailing:
- The amounts of each type of fish caught.
- The total score.
- When the time limit is reached, the game displays a message detailing:
3. Data Management: The fishtypes List
- Purpose: The
fishtypeslist is crucial for tracking the quantity of fish caught. - Functionality:
- It stores data representing the type of fish and the number of that specific fish caught.
- Manages Complexity: By consolidating all fish data into a single list, it avoids the need for numerous individual variables for each fish type and its count, making the code more concise and manageable.
- Extensibility: Allows for easy addition of new fish types by simply adding their data to the existing list.
4. Clone Movement Procedure (clone movement)
- Role: This procedure dictates the behavior of the fish sprites (clones). It determines where a clone spawns, its movement range, and how it behaves when it reaches the edge of the screen.
- Contribution to Gameplay: It enhances the challenge by making fish clones spawn and move randomly, with varying speeds and heights, making them harder to catch with the hook.
4.1. Clone Initialization and Movement Logic
- Initial Spawn:
- A newly spawned clone is positioned at a random X-coordinate on the screen.
- Its height is set randomly within a range defined by the
y1andy2parameters.
- Movement Loop:
- The clone continuously moves until either the game ends or it collides with the hook.
- Edge Detection and Response (If-Else Statement):
- Condition 1: Touching the Right Edge:
- Test: If the clone sprite touches the right edge of the screen.
- Action (First Call): The clone teleports to the left.
- The X-position is set to a value specified by the
rt state(return state) parameter. - The Y-position is set randomly within the
y1toy2range. - Result: This ensures the clone continues moving without exiting the screen.
- The X-position is set to a value specified by the
- Condition 2: Not Touching the Right Edge:
- Test: If the clone sprite is not touching the right edge of the screen.
- Action (Second Call): The clone moves to the right.
- It moves a random number of steps within the range specified by the
s1ands2parameters. - Result: The clone moves horizontally across the screen.
- It moves a random number of steps within the range specified by the
- Condition 1: Touching the Right Edge:
4.2. Procedure Calls and Conditions
- First Call (Returning Call):
- Action:
go to x:(rt state) y: [pick random(y1) to (y2)] - Condition Tested: Whether the clone sprite is touching the edge of the right side of the screen.
- Action:
- Second Call (Normal Movement):
- Action:
change x by [pick random(s1) to (s2)] - Condition Tested: Whether the clone sprite is not touching the edge of the right side.
- Action:
Interactive Conway's Game of Life Simulation
This document describes an interactive program that simulates John Conway's Game of Life, designed for user entertainment. The program allows users to manipulate a grid of cells and observe their evolution according to the game's rules.
Core Functionality
- Interactive Grid Manipulation: Users can place and remove cells on a grid using mouse clicks and position.
- Conway's Game of Life Rules: The simulation progresses programmatically based on the established rules of Conway's Game of Life.
- Generation Updates: The screen updates after each generation to reflect the changes in cell states.
- Simulation Controls: Users can pause (
p), restart (space), and reset (r) the simulation at any time, allowing for editing and replaying.
User Input and Output
- Inputs:
- Keyboard keys:
space(pause/resume),p(pause),r(reset). - Mouse: Clicks and position for placing/removing cells.
- Keyboard keys:
- Outputs:
- Visual representation of the grid with placed or removed cells.
- Progression of cells through simulated generations.
- Updates to the simulation state (paused, reset, cleared).
Cell Placement and Management
- A function checks for existing cells at the current mouse position to allow for placement or removal before the simulation begins.
- The X and Y coordinates of the mouse are used to determine the corresponding cell's location within the data structure.
- Code stores the type of cell last clicked, enabling continuous placement or removal by holding down the mouse button.
Game of Life Rules Implementation
The simulation checks the state of surrounding cells for each cell on the grid.
- Survival: A live cell with two or three live neighbors remains alive.
- Death: A live cell with fewer than two or more than three live neighbors dies.
- Birth: A dead cell with exactly three live neighbors becomes a live cell.
Data Structures and Management
- Lists: Three primary lists are used:
startGrid,currentGrid, andnextGrid. These are maintained to allow for recalling previous states even after edits.startGridandcurrentGridare often identical, withcurrentGridbeing a copy ofstartGridinitially.
- Cell Representation: Each item in these lists represents a single cell on the grid.
- The grid size is 10,800 cells (120x90).
- A value of
0indicates a dead cell, and1indicates a live cell.
- Coordinate Mapping: The position of an item in the list directly corresponds to a cell's coordinates on the grid, and vice versa. This list-based approach is chosen for efficiency and ease of management compared to individual variables.
Simulation Progression (Tick/Generation)
The program progresses the simulation one tick (generation) at a time through a dedicated function.
- Data Copying: All cell data from the
currentGridis copied to thenextGrid. - Neighbor Check: The surroundings of all cells are checked, and the results are recorded for the
nextGrid. - State Update: The
nextGridthen replaces thecurrentGrid, effectively advancing the simulation to the next generation.
List Copying Mechanism (genSwap)
A procedure handles copying data between lists, taking identifying numbers for two lists as input: the source and the destination.
- Purpose: Used to store cell states for a generation, replace one list with another, and recall previous states by copying lists, enabling duplication and saving of grid positions.
- Algorithm:
- Uses nested
if-elsestatements to determine which list to copy from and to, based on the input parameters (0, 1, or 2 representing the three lists). - The destination list is cleared before copying to ensure correct item count.
- A loop iterates through the source list, copying each item to the corresponding position in the destination list.
- Uses nested
- Calls:
- Reset Function: Called with parameters
0, 1(copyingstartGridtocurrentGrid) during program initialization or when the user resets. - Main Generation Function: Called with parameters
2, 1(copyingnextGridtocurrentGrid) after calculating the next generation's state.
- Reset Function: Called with parameters
Reset Functionality
- A simple reset function clears all lists and replaces their contents with placeholder values, effectively returning the simulation to its initial state.
Summary of Poem Generation Program
This document describes a program designed to generate unique poems based on user input for words and formatting preferences, specifically the inclusion or exclusion of articles.
Program Objective and Functionality
- Goal: To explore user creativity by generating unique poems using their chosen words and formatting preferences.
- User Input: Users provide words (nouns, verbs, adverbs) and specify preferences for including articles ("yes" or "no") and the number of poems to generate.
- Output: The program generates a specified number of poems based on the user's input words and article preference.
Core Components and Procedures
-
Word Input and Storage:
- Users are prompted to enter nouns related to specific themes (e.g., trees, ocean, night sky).
- These nouns are stored in a list (e.g.,
nounList).
-
selectWordProcedure:- This procedure is responsible for randomly selecting a word from a given list.
- It uses the
random.randintfunction to pick a random index and thenpops the word from the list, ensuring each word is used only once per poem generation cycle. - Using lists for word storage simplifies random selection and management of multiple words compared to individual variables.
-
createPoemsProcedure:- This is the main procedure for assembling the final poems.
- It takes lists of words (nouns, verbs, adverbs) and an
aSettingparameter (1 for articles, 0 for no articles) as input. - It relies on other, unpictured procedures:
articlePoem(for poems with articles) andnoArticlePoem(for poems without articles). - Logic:
- Initializes a poem counter and an empty string for the final poems.
- Iterates to generate the user-specified number of poems.
- Inside the loop, it uses
ifstatements based onaSettingto call eitherarticlePoemornoArticlePoem. - The generated poem is appended to the final string.
- Finally, it returns the compiled string of poems.
Poem Generation Calls and Conditions
The program demonstrates two distinct calls to the createPoems procedure, differentiated by the aSetting parameter, which is determined by the user's articlePreference.
-
First Call (with articles):
- Code:
print("In" + createPoems(nounList, verbList, adverbList, 1)) aSettingValue:1- Condition Tested: The
if aSetting == 1:condition on line 37 is met. - Result: The
articlePoemprocedure is called, and the generated poems will include articles like "The" and "And".
- Code:
-
Second Call (without articles):
- Code:
print("In" + createPoems(nounList, verbList, adverbList, 0)) aSettingValue:0- Condition Tested: The
if aSetting == 1:condition on line 37 fails. The code proceeds to theif aSetting == 0:condition on line 39, which is met. - Result: The
noArticlePoemprocedure is called, and the generated poems will not include articles like "The" and "And".
- Code:
Example Scenario
The text describes a demonstration where:
- Initially, words like "pine," "star," and "lies" are used with articles, generating 3 poems.
- Subsequently, different words like "forest," "expanse," and "glows" are used without articles, generating 5 poems.
This illustrates how user inputs for words, article preference, and the desired number of poems directly influence the final output.
AP Computer Science Principles Practice Exam Summary
This document contains a practice exam for AP Computer Science Principles, covering a wide range of topics related to algorithms, data representation, the Internet, cybersecurity, and programming. The exam is designed to assess students' understanding of computational thinking practices and essential knowledge statements from the AP Computer Science Principles curriculum framework.
Section 1: Algorithms and Programming
- Program Comparison (Question 15): Compares the output of two programs, focusing on the values displayed, their order, and the number of values.
- Procedure
Max(Question 21): Evaluates expressions using aMaxprocedure to find the greatest of three integer values. - Robot Movement Procedures (Questions 22, 27, 34): Involves understanding and predicting the movement of a robot on a grid based on provided procedures and code segments.
IsHotProcedure (Question 23): Requires completing a procedure that determines if a majority of daily high temperatures in a month meet a certain threshold (>= 90 degrees).- Guessing Game Debugging (Question 30): Identifies where to insert a
win <- trueinstruction to ensure a guessing game loop terminates correctly. - Prime Number Counting (Question 135): Requires identifying and removing incorrect lines of code from a program intended to count prime numbers in a list.
- String Manipulation (Question 64): Uses
ConcatandSubstringprocedures to generate a specific target string. - Frequent Customer Program (Question 43): Implements a logic to set a cost to 0 for every 10th purchase using the
MODoperator. - Calculating Average (Question 42): Compares two code segments for calculating the average of a list, analyzing their correctness and efficiency.
- Procedure
MultiplyError Analysis (Question 137): Identifies conditions under which a procedure intended to multiply integers using repeated addition will not return the correct product. - Procedure
SmallestError Analysis (Question 138): Identifies lists for which a procedure intended to find the smallest value in a list will not return the correct result. - Procedure
KeepPlayingLogic Error (Question 60): Analyzes a procedure that incorrectly determines user input for continuing a game. - Sum of Integers (Question 62): Determines the result of a program that calculates the sum of a specific range of integers.
GetCountandMODOperator (Question 43): Implements logic for a frequent customer program using the modulo operator.MaxProcedure for Grade Calculation (Question 46): Uses theMaxprocedure to calculate a student's adjusted total points based on midterm and final exam scores.PowerProcedure Generalization (Question 59): Identifies a generalized procedure that encompassesSquareandCubeprocedures.IsPalindromeAlgorithm (Question 57): Determines the correct order of steps (sort, filter palindromes, extract first letter) to implement an algorithm.
Section 2: Data Representation and Abstraction
- Minimum Bits for Characters (Question 31): Calculates the minimum number of bits required to represent a given number of unique characters.
- Hexadecimal Color Representation (Question 35): Identifies the hexadecimal number representing the color with the greatest amount of blue.
- Byte Pair Encoding (Questions 25-26): Explains byte pair encoding as a lossless transformation and identifies strings where it cannot shorten the length.
- Metadata in E-books (Question 20): Determines what is LEAST likely to be contained in the metadata of an e-book.
- Representing Data with Bits (Question 49): Analyzes potential overflow errors when using a fixed number of bits (4 bits) to represent non-negative integers.
- Hexadecimal vs. Binary Representation (Question 61): Discusses the benefits of using hexadecimal numbers over binary numbers for data representation.
- Abstraction in Programming (Question 132): Identifies ways programmers use abstraction to manage program complexity (e.g., procedures, data structures).
- Data Representation Trade-offs (Question 41): Explains the result of a floating-point representation error.
Section 3: The Internet and Networking
- Internet Communication Requirements (Question 16): States that every device connected to the Internet is assigned an Internet Protocol (IP) address.
- Domain Name System (DNS) (Question 28): Explains the purpose of DNS in translating domain names to IP addresses.
- Network Configurations and Redundancy (Question 24): Identifies a network configuration where redundant routing between two computers is not possible.
- Open Standards and Protocols (Question 44): Explains the benefit of open standards and protocols for enabling interoperability on the Internet.
- Internet Protocol Versions (IPv4 vs. IPv6) (Question 47): Describes the result of using 128-bit addresses instead of 32-bit addresses in terms of the number of available addresses.
- Distributed Denial-of-Service (DDoS) Attacks (Question 63): Explains how a DDoS attack can compromise a website.
- Web Page Hierarchy (Question 131): Describes the relationship between
example.organdabout.example.orgin terms of domains and subdomains. - Cloud Computing's Impact (Question 136): Identifies how cloud computing has affected Internet communication (enhancing collaboration, introducing security concerns).
- Latency Measurement (Question 39): Identifies the appropriate unit for measuring network connection latency (milliseconds).
Section 4: Cybersecurity and Data Security
- Phishing Attempt Analysis (Question 2): Identifies the privacy risk associated with responding to a suspected phishing email.
- Public Key Cryptography (Question 52): Explains what is needed to decrypt a message encrypted with a recipient's public key (the recipient's private key).
- Symmetric Encryption (Question 56): Provides an example of symmetric encryption.
- Digital Certificates (Question 16): Clarifies the role of digital certificates in Internet communication.
Section 5: Societal and Ethical Impacts of Computing
- Digital Divide (Question 18): Identifies actions that can help reduce the digital divide (education, device access, infrastructure).
- Copyright and Music Sampling (Question 40): Suggests using samples published with a no-rights-reserved Creative Commons license to minimize copyright violation risk.
- Crowdsourcing and the Internet (Question 65): Explains how the Internet enables crowdsourcing (access to tools, information, lowering geographic barriers).
- Online Encyclopedias vs. Traditional (Question 134): Discusses advantages of online encyclopedias (larger number of perspectives, quick updates).
- Data Privacy and User Actions (Question 17): Identifies the LEAST likely consequence of downloading an album from a licensed seller.
Section 6: Models, Simulations, and Data Analysis
- Model Accuracy for Birth Prediction (Question 19): Determines the strategy LEAST likely to improve the accuracy of a birth prediction model.
- Moore's Law Assumption (Question 29): Identifies the underlying assumption of Moore's Law (computing power increases over time).
- Machine Learning Purpose (Question 58): Describes the purpose of machine learning programs (recognizing patterns, making predictions).
- Data Analysis from Survey (Question 36): Forms a hypothesis consistent with data presented in a scatter plot relating reading hours, smartphone usage, and interest in an app.
- Video Streaming Analysis Time (Question 33): Approximates the execution time of a program involving multiple calls to a time-consuming procedure.
- Mouse Population Simulation (Question 38): Identifies an assumption made in a mouse population simulation program (predator population remains constant).
- Photo Data Analysis (Question 9): Determines what information can be derived from photo metadata (location, time).
- Mice Population Simulation Assumption (Question 38): Identifies an assumption made in a simulation about predator population stability.
- Data Sets from Different Schools (Question 133): Determines what can be done with combined data from two schools with different data formats.
- Video Archival (Question 66): Identifies the action LEAST likely to support the goal of saving full-quality digital video files for archival.
Section 7: Logic Gates and Circuits
- Logic Gate Circuit Output (Question 32): Determines the input values that will result in a specific output (false) from a given logic gate circuit.
- NAND Gate Boolean Expression (Question 50): Models a NAND gate using a Boolean expression.
Section 8: Number Representation and Errors
- Floating-Point Representation (Question 41): Explains why a calculation results in a repeating decimal due to floating-point precision limits.
- Integer Representation and Overflow (Question 49): Identifies operations that will result in an overflow error when using 4 bits for non-negative integers.
Section 9: Internet Protocols and Services
- Internet Communication Standards (Question 16): States that devices need an IP address to communicate on the Internet.
- Domain Name System (DNS) (Question 28): Explains the function of DNS.
- Internet Engineering Task Force (IETF) (Question 6): Describes the role of the IETF in developing Internet standards.
- Cloud Computing and Internet Communication (Question 136): Discusses the impact of cloud computing on Internet communication.
Section 10: Computational Problem Solving
- Undecidable Problems (Question 51): Explains that it is not possible to create an algorithm that solves the halting problem for all programs and inputs.
- Algorithm Efficiency (Question 48): Characterizes an algorithm's performance for large inputs based on a table of steps.
Section 11: Multiple-Select Questions (Two Correct Answers Required)
- Cloud Computing Impact (Question 136): Selects two statements describing the effects of cloud computing on Internet communication.
- Abstraction in Programming (Question 132): Selects two methods programmers use to manage program complexity through abstraction.
- Online Encyclopedia Advantages (Question 134): Selects two advantages of an online encyclopedia over a traditional paper-based one.
- Prime Number Program Correction (Question 135): Identifies two lines of code to be removed to correct a prime number counting program.
- Web Page Hierarchy (Question 131): Selects two accurate statements about the hierarchy of web pages.
- Crowdsourcing and the Internet (Question 65): Selects two true statements about how the Internet enables crowdsourcing.
- Procedure
MultiplyError Conditions (Question 137): Selects two conditions under which theMultiplyprocedure will not return the correct product. - Procedure
SmallestError Lists (Question 138): Selects two lists for which theSmallestprocedure will not return the intended value.
好的,ap master!以下是基于你上传的8套AP Computer Science Principles(CSP)真题、样题和评论文件内容,为你整理的高频知识点及核心terms。为便于理解,我按照【知识点分类】【核心术语】【英文】【中文解释】双语表格形式给出,助你临考系统复习。
AP Computer Science Principles 高频知识点&核心术语对照表
| 知识点分类 | 英文核心Term | 中文术语/释义 | 额外说明(考查亮点、命题角度) | |----------------------|-------------------------|-------------------------------------|---------------------| | Algorithms | Algorithm | 算法 | 流程步骤、效率、可实现性,顺序结构/选择/循环结构等 | | | Procedure/Function | 程序/函数/过程 | 带/不带参数,有无返回值,自定义功能模块 | | | Boolean Expression | 布尔表达式/逻辑表达式 | 条件判断,true/false | | | Selection Statement | 选择语句 | if-else结构 | | | Iteration/Loop | 循环结构 | for/repeat/do while | | Data & Abstraction | List/Array | 列表/数组 | 管理复杂数据、更高效遍历/查找 | | | Abstraction | 抽象 | 管理复杂性、简化代码 | | | High-level Language | 高级编程语言 | 易读性&抽象性(和低级语言对比) | | Modeling & Simulation| Simulation/Model | 模拟/建模 | 用程序模拟真实现象找结论,抽象与实践结合 | | Data Analysis | Data Storage/Variable | 数据存储结构/变量 | 数据类型识别与区分:数字、字符串、布尔值 | | | Metadata | 元数据 | 附加信息(如图片、文件附带时间地点等) | | | Pattern Recognition | 模式识别 | 发现规律找趋势,用于算法优化 | | System/Architecture | Internet Protocol(IP) | 网络协议/IP地址 | IP地址、包分片与重组、IPv4/IPv6 | | | Open Standards/Protocol | 开放标准/协议 | 不同厂家设备互通关键 | | | DNS (Domain Name System)| 域名系统 | 域名与IP地址映射 | | Security | Encryption | 加密 | 对称加密/非对称加密;公钥/私钥;传输安全认证 | | | Phishing | 网络钓鱼 | 通常考场景判断与防护方法 | | | Digital Certificate | 数字证书 | 网站真实身份认证 | | Social Impact | Crowdsourcing | 众包 | 利用互联网聚集智慧 | | | Digital Divide | 数字鸿沟 | 技术普及、教育机会不均等问题 | | | Copyright/Creative Commons | 版权/创作共用协议 | 网络素材合法性 | | | Collaboration | 协作 | 小组合作、协同开发、在线共享 | | | Cloud Computing | 云计算 | 数据存储、远程协作、隐私安全 |
高频知识点详细说明举例(部分)
- Algorithm/Procedure/Boolean Expression/Selection(算法/过程/布尔表达式/选择结构)
- 连续考查:如描述算法步骤、解释if结构布尔条件为何为真、叙述某参数具体影响分支选择,典型例子见简答与多选题[19]Source: 2025 AP Computer Science Principles北美FRQ .pdfAP COMPUTER SCIENCE PRINCIPLES 2025 - FREE-RESPONSE QUESTIONS COMPUTER SCIENCE PRINCIPLES SECTION II TIME - 60 MINUTES Directions: Section II has 2 questions (4 written-response prompts) and lasts 60 minutes. The questions for this section are based on the Create Performance Task you previously submitted. Refer to your Personalized Project Reference for the code segments related to your list and procedure. You may use scratch paper for notes and planning, but credit will only be given for responses entered in this application. Text you enter as an annotation will not be included as part of your answer. You can go back and forth between questions in this section until time expires. The clock will turn red when 5 minutes remain-the proctor will not give you any time updates or warnings. Note: This exam was originally administered digitally. It is presented here in a format optimized for teacher and student use in the classroom. AP COMPUTER SCIENCE PRINCIPLES 2025 - FREE-RESPONSE QUESTIONS 1. Identify an example output of your program. Explain how this output shows an aspect of your program's functionality. AP COMPUTER SCIENCE PRINCIPLES 2025 - FREE-RESPONSE QUESTIONS 2. Refer to your Personalized Project Reference when answering this question. A. Consider the first selection statement included in the Procedure section of your Personalized Project Reference. Identify the Boolean expression in this selection statement. Identify a specific value or set of values that will cause this expression to evaluate to true. Explain why the specified value(s) will cause the expression to evaluate to true.[52]Source: 2025 AP Computer Science Principles北美FRQ .pdfB. Consider the procedure included in part (i) of the Procedure section of your Personalized Project Reference. Suppose another programmer modifies the code within this procedure. Describe a modification the other programmer could make that would cause this procedure to have a logic error. Describe how the behavior of this procedure would change because of the error. C. Consider the list included in the List section of your Personalized Project Reference. Suppose another programmer adds several new elements to the end of the list. Explain how the code segment in part (ii) of the List section would need to be modified to account for the additional elements. If no changes to the code segment are necessary, explain why this is the case for your program. STOP END OF EXAM AP COMPUTER SCIENCE PRINCIPLES 2025 - FREE-RESPONSE QUESTIONS 1. Identify an unexpected or invalid input that a user could provide to your program. Describe the behavior of your program after it receives this input. If it is not possible for your program to accept an unexpected or invalid input, explain why this is the case. AP COMPUTER SCIENCE PRINCIPLES 2025 - FREE-RESPONSE QUESTIONS 2. Refer to your Personalized Project Reference when answering this question. A. Consider the first selection statement included in the Procedure section of your Personalized Project Reference. Identify the Boolean expression in this selection statement. Identify a specific value or set of values that will cause this expression to evaluate to false. Explain why the specified value(s) will cause this expression to evaluate to false. B. Consider the code segment in part (ii) of the List section of your Personalized Project Reference. Suppose another programmer modifies this code segment. Describe a modification the other programmer could make to this code segment that would result in a logic error. Explain why this modification would result in a logic error. C. Consider the procedure identified in part (i) of the Procedure section of your Personalized Project Reference. Describe the functionality provided by this procedure. Explain how implementing this functionality as a procedure results in your program being easier to maintain than if the functionality were not implemented as a procedure. STOP END OF EXAM。
- Data与Abstraction(数据结构/抽象)
- 列表(List/Array)高频出现,无论在打分实例还是选择题都涉及,如高效存储多组数据、简化代码[49]Source: ap-computer-science-principles-2022-create-performance-task-sample-c.pdfsetText ("let" + i, letter) ; check = true; count = count + 1; } 54 } 3. b. iii. "letOfGuessWord" 3. b. iv. The data that my list contains is vital to my program since it holds the individual letters of the word that the user is trying to guess in their own individual indexes. Create Sample C 1 of 3 e Academy 35 36 37 3. b. v. Create Sample C 2 of 3[129]Source: ap-computer-science-principles-2022-create-performance-task-sample-b.pdfUsing a list here enables efficient random selection of an element within the list and then returning that noun at a specific point when I invoke the selectWord method. In this way, it manages the complexity of random selection and the storage of multiple nouns at once. If I did not have this list, I would have to store the noun inputs in different variables and keep invoking those different variables instead, as well as finding another way to randomize selection, perhaps using the generation of a random integer, each corresponding to its own selection/if statement, but in that case I would have to write individual statements for each possible int generated and make the code a lot more cluttered. 3 c. 3. c. i. Create Sample B 2 of 3 # Function to create the poems def createPoems (nList, vList, aList, aSetting): i = 0 finalPoems while i < poemNum: if aSetting == 1: finalPoems += articlePoem(nList, vList, aList) + "\n\n" if aSetting == 0: finalPoems += noArticlePoem(nList, vList, aList) + "\n\n" i += 1[111]Source: ap-computer-science-principles-2022-create-performance-task-sample-e.pdfCreate Sample E 2 of 3 The data in this list represents the type of fish and the number of a specific fish caught. 3. b. v. The list manages complexity by keeping the data altogether in one easy list. Without the list, the program would need to have multiple variables for each type of fish and their own amounts, making the program unnecessarily longer. The list compiles all that fish data into one spot. Since all the data of the fish types and their respective amounts are in this one list, it is easier to use the information since the info can be extracted easier. If another fish was added to the fishing game, one could simply add data of the fish into the list instead of making a new variable. 3 c. 3. c. i. + clone + movement + range + of + y + y1 +-+ y2 + speed + range + s1 +-+ s2 + return + state + rt state + go to x: pick random -600 to y: pick random v1。
- Systems/Protocols(协议、DNS、IP等)
- 互联网通信机制常规考点,如标准协议作用、DNS域名功能、IPv6比IPv4多多少地址、open standards为何重要[21]Source: AP CSP-2018.pdf6. Which of the following best describes the role of the Internet Engineering Task Force (IETF) ? (A) Developing standards and protocols for Internet communication (B) Preventing copyrighted materials from being illegally distributed online (C) Preventing malicious software from being distributed online (D) Verifying the ownership of encrypted keys used in secured messages 7. Consider the following program, which uses the variables start, end, and current. start < 1 end - 20 current < 3 start « current current ‹ current + 1 DISPLAY (start) DISPLAY (current) What is displayed as a result of executing the program? (A) 1 3 (B) 3 3 (C) 3 4 (D) 4 4 GO ON TO THE NEXT PAGE. 22 AP Computer Science Principles Practice Exam 8. Which of the following best characterizes a high-level programming language? (A) A language comprised entirely of hardware logic gates (B) A language in which each instruction corresponds directly to an instruction in a computer's machine code (C) A language that is easy for a computer to interpret but difficult for humans to interpret (D) A language that uses multiple abstractions to manage complexity 9. A smartphone stores the following data for each photo that is taken using the phone. · The file name of the photo · The date and time the photo was taken · The geographic location where the photo was taken Assume that all of the photos that have been taken on the phone are accessible. Which of the following can be determined using the photo data described above? I. The number of photos that were taken at a particular geographic location II. The number of photos that were taken in the last year III. The name of the person who took the most recent photo (A) III only (B) I and II only (C) I and III only (D) I, II, and III GO ON TO THE NEXT PAGE.[40]Source: AP CSP-2018.pdf28. Which of the following allows users to refer to Web sites using names, such as example. com, rather than numbers, such as 93. 184. 216. 34 ? (A) A digital certificate (B) The domain name system (DNS) (C) The hypertext transfer protocol (HTTP) (D) The simple mail transfer protocol (SMTP) 29. Which of the following is an underlying assumption that is made when Moore's law is used? (A) As computer hardware improves, the algorithms used in programs will become more efficient. (B) As computer hardware improves, developers will become more skilled at writing code. (C) As computer hardware improves, future computers will be able to run faster than current computers. (D) As computer hardware improves, the number of cybersecurity concerns will increase. GO ON TO THE NEXT PAGE. 38 AP Computer Science Principles Practice Exam 30. A student wrote the following code for a guessing game. Line 1: secretNumber < RANDOM (1, 100) Line 2: win « false Line 3: REPEAT UNTIL (win) { Line 4: Line 5: DISPLAY ( "Guess a number. " ) Line 6: guess < INPUT () Line 7: IF (guess = secretNumber) { Line 8: Line 9: DISPLAY ( "You got it right !") Line 10: } Line 11: ELSE Line 12: { Line 13: IF (guess > secretNumber) Line 14: {。
- Security(安全)
- Social Issues(社会影响/伦理/协作/众包/云计算等)
重点背诵建议
- 熟记术语的英文与权威定义,能结合代码和实际场景简明扼要解释其作用;
- 算法题注意if/else的条件分支、list操作、循环变量变化(可用流程图辅助理解);
- 互联网协议、加密技术简答题要会结合图示准确描述流程;
- 社会影响题重在分析“创新”“协作”“公平”等多角度,例题常用你身边的实际事例来解释。
祝你AP考试一切顺利,ap master!如需某一知识点精讲/练习/习题解析,随时召唤我!
ap master,你问的“数据结构”在AP CS Principles中核心是理解和应用“列表(list, array)”“元数据(metadata)”“变量(variable)”“抽象(abstraction)”等知识点,不侧重考花哨的数据结构算法,而是实际如何用这些工具“简化、管理和处理复杂数据”。以下用真题例子和讲解,帮你一步步搞懂。
高频数据结构知识点
| 英文名称 | 中文术语 | 释义/理解 | 典型真题/考查角度 | |---------------|------------------|----------------------------------------------------------|------------------------------------------------| | List/Array | 列表/数组 | 一组有顺序的数据,可以用下标访问、修改、遍历等 | 例题涉及用list存储多个变量、优化复杂度[7]Source: AP CSP-2018.pdfThis option is incorrect. Placing all documentation in a single line does not help a programmer to manage the complexity of a program. (D) This option is correct. Creating a list of names is an example of a data abstraction that may make it easier for a programmer to manage the complexity of a program. 108 AP Computer Science Principles Practice Exam Question 133 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 3. 2 Computing facilitates exploration and the discovery of connections in information. 3. 2. 1 Extract information from data to discover and explain connections or trends. P1 Connecting computing 3. 2. 1A 3. 2. 1B 3. 2. 1C (A) This option is correct. It is possible to create a single list of student names, sorted by last name. Both data formats provide the first and last names of each student. (B) This option is correct. It is possible to determine the average number of days students are absent. Both data formats provide the number of absences for each student. (C) This option is incorrect. East High School provides the ZIP code of each student, but West High School does not. (D) This option is incorrect. West High School provides a student ID for each student, but East High School does not. Question 134 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 7. 1 Computing enhances communication, interaction, and cognition. 7. 1. 2 Explain how people participate in a problem- solving process that scales. P4 Analyzing problems and artifacts 7. 1. 2D 7. 1. 2E[45]Source: ap-computer-science-principles-2022-create-performance-task-sample-c.pdf3. b. ii. 48 + for (var i = 0; i < letOfGuessWord. length; i ++) { if (letter == letOfGuessWord [i] ) { 49 + setText ("let" + i, letter) ; check = true; count = count + 1; } 54 } 3. b. iii. "letOfGuessWord" 3. b. iv. The data that my list contains is vital to my program since it holds the individual letters of the word that the user is trying to guess in their own individual indexes. Create Sample C 1 of 3[49]Source: ap-computer-science-principles-2022-create-performance-task-sample-e.pdfCreate Sample E 2 of 3 The data in this list represents the type of fish and the number of a specific fish caught. 3. b. v. The list manages complexity by keeping the data altogether in one easy list. Without the list, the program would need to have multiple variables for each type of fish and their own amounts, making the program unnecessarily longer. The list compiles all that fish data into one spot. Since all the data of the fish types and their respective amounts are in this one list, it is easier to use the information since the info can be extracted easier. If another fish was added to the fishing game, one could simply add data of the fish into the list instead of making a new variable. 3 c. 3. c. i. + clone + movement + range + of + y + y1 +-+ y2 + speed + range + s1 +-+ s2 + return + state + rt state + go to x: pick random -600 to y: pick random v1等 | | Variable | 变量 | 临时存储单个数据值 | 用于存储状态、临时结果 | | Metadata | 元数据 | 描述数据的数据,比如图片的拍摄时间、文件大小、类型等 | 考查“元数据能/不能”推断什么,其与数据本体的区别[10]Source: AP CSP-2016.pdf3. 1. 1E 3. 1 People use computer programs to process information to gain insight and knowledge. 3. 1. 1 Find patterns and test hypotheses about digitally processed information to gain insight and knowledge. (A) This option is incorrect. Statement I is not correct because this goal would require analysis of the data in the call, not the metadata. (B) This option is incorrect. Statement III is also correct because the metadata stores the phone numbers of the two parties of a call. Given one phone number, the metadata can be processed to provide all phone numbers that were called by or placed to that person. (C) This option is correct. Statement II is correct because the repository of stored metadata includes time, so information about the time of calls can be analyzed to make predictions about future calls. Statement III is correct because the metadata stores the phone numbers of the two parties of a call. Given one phone number, the metadata can be processed to provide all phone numbers that were called by or placed to that person. (D) This option is incorrect. Statement I is not correct because this goal would require analysis of the data in the call, not the metadata. 104 AP Computer Science Principles Practice Exam Question 52 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 4. 1 Algorithms are precise sequences of instructions for processes that can be executed by a computer and are implemented using programming languages. 5. 2 People write programs to execute algorithms. 4. 1. 1 Develop an algorithm for implementation in a program. P2 Creating 4. 1. 1B 4. 1. 1C computational artifacts 4. 1. 1D 5. 2. 1A P3 Abstracting P1 Connecting computing 5. 2. 1B 5. 2. 1C 5. 5. 1A 5. 5. 1D 5. 5. 1E 5. 5 Programming uses mathematical and logical concepts. (A) | | Data Abstraction | 数据抽象 | 用能代表一组数据的方式简化操作,最常见为列表/字典/常量等 | 用抽象“管理复杂度”,提高可维护性[7]Source: AP CSP-2018.pdfThis option is incorrect. Placing all documentation in a single line does not help a programmer to manage the complexity of a program. (D) This option is correct. Creating a list of names is an example of a data abstraction that may make it easier for a programmer to manage the complexity of a program. 108 AP Computer Science Principles Practice Exam Question 133 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 3. 2 Computing facilitates exploration and the discovery of connections in information. 3. 2. 1 Extract information from data to discover and explain connections or trends. P1 Connecting computing 3. 2. 1A 3. 2. 1B 3. 2. 1C (A) This option is correct. It is possible to create a single list of student names, sorted by last name. Both data formats provide the first and last names of each student. (B) This option is correct. It is possible to determine the average number of days students are absent. Both data formats provide the number of absences for each student. (C) This option is incorrect. East High School provides the ZIP code of each student, but West High School does not. (D) This option is incorrect. West High School provides a student ID for each student, but East High School does not. Question 134 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 7. 1 Computing enhances communication, interaction, and cognition. 7. 1. 2 Explain how people participate in a problem- solving process that scales. P4 Analyzing problems and artifacts 7. 1. 2D 7. 1. 2E[12]Source: AP CSP-2018.pdfLearning Objective Computational Thinking Practice Essential Knowledge 5. 3 Programming is facilitated by appropriate abstractions. 5. 3. 1 Use abstraction to manage complexity in programs. P3 Abstracting 5. 3. 1A 5. 3. 1B 5. 3. 1C 5. 3. 1D 5. 3. 1E 5. 3. 1F 5. 3. 1G (A) This option is incorrect. This code segment moves the robot forward two squares, rotates it right one time so that the robot faces the bottom of the grid, and then moves the robot forward three squares. (B) This option is correct. This code segment moves the robot forward two squares, rotates it right three times so that the robot faces the top of the grid, and then moves the robot forward three squares to the gray square. (C) This option is incorrect. This code segment moves the robot forward three squares, rotates it right one time so that the robot faces the bottom of the grid, and then moves the robot forward three squares. (D) This option is incorrect. This code segment moves the robot forward three squares, rotates it right three times so that the robot faces the top of the grid, and then moves the robot forward three squares. 82 AP Computer Science Principles Practice Exam Question 23 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 5. 5 Programming uses mathematical and logical concepts. 5. 5. 1 Employ appropriate mathematical and logical concepts in programming. P1 Connecting computing 5. 3. 1A 5. 3. 1B 5. 3. 1C 5. 3. 1D[13]Source: AP CSP-2018.pdfEnduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 6. 2 Characteristics of the Internet influence the systems built on it. 6. 2. 1 Explain characteristics of the Internet and the systems built on it. P5 Communicating 6. 2. 1A 6. 2. 1B (A) This option is incorrect. In the domain name hierarchy, about . example. org is not related to about . org. (B) This option is correct. In the domain name hierarchy, about . example. org is a subdomain of example. org. (C) This option is correct. In the domain name hierarchy, example. org is under the top-level domain . org. (D) This option is incorrect. The top-level domain associated with example. org is . org. Question 132 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 5. 3 Programming is facilitated by appropriate abstractions. 5. 3. 1 Use abstraction to manage complexity in programs. P3 Abstracting 5. 3. 1C 5. 3. 1E 5. 3. 1L (A) This option is correct. Placing repeated code with procedure calls is an example of a procedural abstraction that may make it easier for a programmer to manage the complexity of a program. (B) This option is incorrect. Using shorter variable names would not help a programmer to manage the complexity of a program. In general, meaningful variable names help programmers better understand programs. (C) |
知识点详解+真题举例
1. 列表(List/Array)
概念
- 列表是一串有序元素集合。每个元素有下标(index),通常从1或0开始。
- 常见操作:添加、删除、访问(list[i])、遍历(for)、求长度等。
为什么用列表?
- 一组值用一个list变量替代多个变量,减少代码复杂性、提高拓展性。
- 例:存储10个分数用list比10个score1、score2...方便。
真题例子
-
选项型题目考法:
创建一串学生名字用list是管理复杂度的数据抽象,分开变量name1、name2不好维护[7]Source: AP CSP-2018.pdfThis option is incorrect. Placing all documentation in a single line does not help a programmer to manage the complexity of a program. (D) This option is correct. Creating a list of names is an example of a data abstraction that may make it easier for a programmer to manage the complexity of a program. 108 AP Computer Science Principles Practice Exam Question 133 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 3. 2 Computing facilitates exploration and the discovery of connections in information. 3. 2. 1 Extract information from data to discover and explain connections or trends. P1 Connecting computing 3. 2. 1A 3. 2. 1B 3. 2. 1C (A) This option is correct. It is possible to create a single list of student names, sorted by last name. Both data formats provide the first and last names of each student. (B) This option is correct. It is possible to determine the average number of days students are absent. Both data formats provide the number of absences for each student. (C) This option is incorrect. East High School provides the ZIP code of each student, but West High School does not. (D) This option is incorrect. West High School provides a student ID for each student, but East High School does not. Question 134 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 7. 1 Computing enhances communication, interaction, and cognition. 7. 1. 2 Explain how people participate in a problem- solving process that scales. P4 Analyzing problems and artifacts 7. 1. 2D 7. 1. 2E[13]Source: AP CSP-2018.pdfEnduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 6. 2 Characteristics of the Internet influence the systems built on it. 6. 2. 1 Explain characteristics of the Internet and the systems built on it. P5 Communicating 6. 2. 1A 6. 2. 1B (A) This option is incorrect. In the domain name hierarchy, about . example. org is not related to about . org. (B) This option is correct. In the domain name hierarchy, about . example. org is a subdomain of example. org. (C) This option is correct. In the domain name hierarchy, example. org is under the top-level domain . org. (D) This option is incorrect. The top-level domain associated with example. org is . org. Question 132 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 5. 3 Programming is facilitated by appropriate abstractions. 5. 3. 1 Use abstraction to manage complexity in programs. P3 Abstracting 5. 3. 1C 5. 3. 1E 5. 3. 1L (A) This option is correct. Placing repeated code with procedure calls is an example of a procedural abstraction that may make it easier for a programmer to manage the complexity of a program. (B) This option is incorrect. Using shorter variable names would not help a programmer to manage the complexity of a program. In general, meaningful variable names help programmers better understand programs. (C)。
-
编程型题目考法(简答题或代码片段):
for EACH item IN list { /* code 操作每一个item */ }- Code中常出现:“If the program were to run without the list, it would be very inefficient...” —— 没有list要写n多变量,代码又臭又长[45]Source: ap-computer-science-principles-2022-create-performance-task-sample-c.pdf3. b. ii. 48 + for (var i = 0; i < letOfGuessWord. length; i ++) { if (letter == letOfGuessWord [i] ) { 49 + setText ("let" + i, letter) ; check = true; count = count + 1; } 54 } 3. b. iii. "letOfGuessWord" 3. b. iv. The data that my list contains is vital to my program since it holds the individual letters of the word that the user is trying to guess in their own individual indexes. Create Sample C 1 of 3[49]Source: ap-computer-science-principles-2022-create-performance-task-sample-e.pdfCreate Sample E 2 of 3 The data in this list represents the type of fish and the number of a specific fish caught. 3. b. v. The list manages complexity by keeping the data altogether in one easy list. Without the list, the program would need to have multiple variables for each type of fish and their own amounts, making the program unnecessarily longer. The list compiles all that fish data into one spot. Since all the data of the fish types and their respective amounts are in this one list, it is easier to use the information since the info can be extracted easier. If another fish was added to the fishing game, one could simply add data of the fish into the list instead of making a new variable. 3 c. 3. c. i. + clone + movement + range + of + y + y1 +-+ y2 + speed + range + s1 +-+ s2 + return + state + rt state + go to x: pick random -600 to y: pick random v1[50]Source: ap-computer-science-principles-2022-create-performance-task-sample-a.pdfx else 3. b. v. Create Sample A 3 of 5 10,800 items must be kept track of, with a single position corresponding to a single cell, and a way to find one from the other. To do so with variables or some other method would be a monumental task, and very inefficient, so the simplest and easiest way is to do so is with a list. A list also consolidates all that information in one place, making it easier to use and keep track of. In a list, it is also easier to replace one individual item than it would be to replace a single character in a variable or other tracking method. 3 c. 3. c. i. Jefine replaceList current replacement current then x M replacement then pretty long, all of it is pretty much the same. set Iterate(genSwap) + This just replaces one list with the contents of delete all of currentGrid . two inputs given to the repeat length of startGrid - add Item。
例题&解析
-
管理复杂性(抽象)
Which of the following are ways in which a programmer can use abstraction to manage the complexity of a program? (选A和D) A. Replacing each instance of repeated code with a call to a procedure
D. Replacing string variables name1, name2...name4 with a list names -
真实案例拆解(创造任务)
- 评价:如果不用
letOfGuessWord(即用变量a、b、c、d),则每次增加一个字都要多一个变量,且循环比对字符串要写多层判断,极其低效[47]Source: ap-computer-science-principles-2022-create-performance-task-sample-c.pdf3. b. iii. "letOfGuessWord" 3. b. iv. The data that my list contains is vital to my program since it holds the individual letters of the word that the user is trying to guess in their own individual indexes. Create Sample C 1 of 3 e Academy 35 36 37 3. b. v. Create Sample C 2 of 3 If the program were to run without the "letOfGuessWord" list, it would make everything very inefficient because I would have to make 5 new variables to store the individual letters, that is taken from the randomly generated word, into each variable. This will also make my for loop more complicated since I would have to loop trough the strings to see if the letter that the user inputted, is in fact in the word. 3 c. 3. c. i.[70]Source: ap-computer-science-principles-2022-create-performance-task-sample-c.pdfe Academy 35 36 37 3. b. v. Create Sample C 2 of 3 If the program were to run without the "letOfGuessWord" list, it would make everything very inefficient because I would have to make 5 new variables to store the individual letters, that is taken from the randomly generated word, into each variable. This will also make my for loop more complicated since I would have to loop trough the strings to see if the letter that the user inputted, is in fact in the word. 3 c. 3. c. i. 46 - function guessWords ( letter) { 47 check = false; for(var i = 0; i < letOfGuessWord. length; i ++) { if (letter == letOfGuessWord [i] ) { 48 + 49 + 50 51 check = true; 52 count = count + 1; } setText ("let" + i, letter) ;。
- 评价:如果不用
-
数据抽象性能(代码段提升)
- 评分规则:如用
fishtypeslist统计各种鱼的数量,便于后续加新鱼种也只需append,不会导致多出好几个变量,维护比“一条鱼一种变量”方便许多[43]Source: ap-computer-science-principles-2022-create-performance-task-sample-e.pdfTable 3. b. ii. when I receive End statement for = to You caught item of item of fishtypes for item of item of fishtypes secs[49]Source: ap-computer-science-principles-2022-create-performance-task-sample-e.pdfCreate Sample E 2 of 3 The data in this list represents the type of fish and the number of a specific fish caught. 3. b. v. The list manages complexity by keeping the data altogether in one easy list. Without the list, the program would need to have multiple variables for each type of fish and their own amounts, making the program unnecessarily longer. The list compiles all that fish data into one spot. Since all the data of the fish types and their respective amounts are in this one list, it is easier to use the information since the info can be extracted easier. If another fish was added to the fishing game, one could simply add data of the fish into the list instead of making a new variable. 3 c. 3. c. i. + clone + movement + range + of + y + y1 +-+ y2 + speed + range + s1 +-+ s2 + return + state + rt state + go to x: pick random -600 to y: pick random v1。
- 评分规则:如用
2. 变量(Variable)
概念
- 一个变量只能存储一个值,如果有多组相关数据建议用列表处理
真题考点:
3. 元数据(Metadata)
概念
- 元数据是“数据的属性描述”
- 在AP CSP中,常见元数据如:文件的时间戳、类型、大小、拍摄设备等
真题考查
4. 抽象(Abstraction)
概念
- 用更高级的方式简化底层细节,list是典型的数据抽象实例
- 好的抽象使得程序可扩展、易读、易维护
真题考点
真题技巧总结
-
列表操作常见真题场景:
- 批量处理数据(如所有同学成绩/所有游戏角色状态)
- 利用循环(for EACH/for i)给每一项赋值或读值
- 随机访问、动态扩容、去重、排序等
- 只用一组变量而不是一堆变量,简化程序结构[7]Source: AP CSP-2018.pdfThis option is incorrect. Placing all documentation in a single line does not help a programmer to manage the complexity of a program. (D) This option is correct. Creating a list of names is an example of a data abstraction that may make it easier for a programmer to manage the complexity of a program. 108 AP Computer Science Principles Practice Exam Question 133 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 3. 2 Computing facilitates exploration and the discovery of connections in information. 3. 2. 1 Extract information from data to discover and explain connections or trends. P1 Connecting computing 3. 2. 1A 3. 2. 1B 3. 2. 1C (A) This option is correct. It is possible to create a single list of student names, sorted by last name. Both data formats provide the first and last names of each student. (B) This option is correct. It is possible to determine the average number of days students are absent. Both data formats provide the number of absences for each student. (C) This option is incorrect. East High School provides the ZIP code of each student, but West High School does not. (D) This option is incorrect. West High School provides a student ID for each student, but East High School does not. Question 134 Enduring Understanding Learning Objective Computational Thinking Practice Essential Knowledge 7. 1 Computing enhances communication, interaction, and cognition. 7. 1. 2 Explain how people participate in a problem- solving process that scales. P4 Analyzing problems and artifacts 7. 1. 2D 7. 1. 2E[45]Source: ap-computer-science-principles-2022-create-performance-task-sample-c.pdf3. b. ii. 48 + for (var i = 0; i < letOfGuessWord. length; i ++) { if (letter == letOfGuessWord [i] ) { 49 + setText ("let" + i, letter) ; check = true; count = count + 1; } 54 } 3. b. iii. "letOfGuessWord" 3. b. iv. The data that my list contains is vital to my program since it holds the individual letters of the word that the user is trying to guess in their own individual indexes. Create Sample C 1 of 3[49]Source: ap-computer-science-principles-2022-create-performance-task-sample-e.pdfCreate Sample E 2 of 3 The data in this list represents the type of fish and the number of a specific fish caught. 3. b. v. The list manages complexity by keeping the data altogether in one easy list. Without the list, the program would need to have multiple variables for each type of fish and their own amounts, making the program unnecessarily longer. The list compiles all that fish data into one spot. Since all the data of the fish types and their respective amounts are in this one list, it is easier to use the information since the info can be extracted easier. If another fish was added to the fishing game, one could simply add data of the fish into the list instead of making a new variable. 3 c. 3. c. i. + clone + movement + range + of + y + y1 +-+ y2 + speed + range + s1 +-+ s2 + return + state + rt state + go to x: pick random -600 to y: pick random v1[50]Source: ap-computer-science-principles-2022-create-performance-task-sample-a.pdfx else 3. b. v. Create Sample A 3 of 5 10,800 items must be kept track of, with a single position corresponding to a single cell, and a way to find one from the other. To do so with variables or some other method would be a monumental task, and very inefficient, so the simplest and easiest way is to do so is with a list. A list also consolidates all that information in one place, making it easier to use and keep track of. In a list, it is also easier to replace one individual item than it would be to replace a single character in a variable or other tracking method. 3 c. 3. c. i. Jefine replaceList current replacement current then x M replacement then pretty long, all of it is pretty much the same. set Iterate(genSwap) + This just replaces one list with the contents of delete all of currentGrid . two inputs given to the repeat length of startGrid - add Item。
-
元数据考点
- 只做“描述”,分析用途清楚区分数据本体和元数据
核心词汇&术语中英对照表
| 英文术语 | 中文对照 | 学习场景说明 | |---------------|------------------|------------------------------------------| | List/Array | 列表/数组 | 数据集,如各个分数、颜色、物品名称 | | Abstract | 抽象 | 管理复杂性,统一处理,代码简洁 | | Variable | 变量 | 存单一值,如”分数“、”临时结果“ | | Metadata | 元数据 | 文件属性、数据描述 | | Index | 下标/索引 | 列表中的第几个元素(从0或1开始) | | Item/Element | 元素/成员 | 列表里的每一项 | | Traverse | 遍历 | 通常用for循环访问列表里的每个元素 |
拓展练习:自查
- 请用list写一个保存班里所有成绩的简单例子,并实现求平均分。
- 思考:如果后续班里人数增加或者减少,为什么用list方便?
- 请说说元数据和普通数据的区别,各举一例。
有问题就问我,ap master!考前看不明白也可以把题目截图直接甩给我详细讲解。
Ask Sia for quick explanations, examples, and study support.