Skip to content

AP-CSPrinciples/CSP-using_Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computer Science Principles

Computer science involves problem-solving, hardware, and algorithms that help people utilize computers and incorporate multiple perspectives to address real-world problems in contemporary life. As the application of computer science is integrated into more aspects of our lives, it is important to understand the impact of computer science and how to maintain privacy, safety, and security not only when using computers but also while being the innovators of new computing applications. The course strives to engage all students, including those who have traditionally been underrepresented in computer science—such as female students, students of color, students with disabilities, and rural students—by allowing them to discover the power of computer science through rewarding yet challenging concepts.

AP� Computer �Science �Principles �introduces �students �to �the� breadth� of� the �field� of �computer� science. In this course, students will learn to design and evaluate solutions and to apply computer science to solve problems through the development of algorithms and programs. They will incorporate abstraction into programs and use data to discover new knowledge. Students will also explain how computing innovations and computing systems, including the Internet, work, explore their potential impacts, and contribute to a computing culture that is collaborative and ethical. It is important to note that the AP Computer Science Principles course �does� not �have� a� designated� programming�language.� Teachers �have� the �flexibility� to choose a programming language(s) that is most appropriate for their students to use in the classroom

The main goals of an introductory �college-level� computer� science �course:�

  • Computational Solution Design—Design� and� evaluate computational solutions for a purpose.
  • Algorithms and Program Development—Develop� and implement algorithms.
  • Abstraction in Program Development—Develop� programs that incorporate abstractions.
  • Code Analysis—Evaluate�and�test�algorithms�and� programs.
  • Computing Innovations—Investigate�computing� innovations.
  • Responsible Computing—Contribute�to�an� inclusive, safe, collaborative, and ethical computing

RubberDuckProtocol

https://ctlessons.org/

Turtle Graphics

*** This course is designed to prepare students to take the AP Computer Science Principles Exam ***
*** Excerpts from the course overview was taken from AP CollegeBoard ***

Table of Contents

Click Here

Computational Solution Design Algorithms and Program Development Abstraction in Program Development Code Analysis Computing Innovations Responsible Computing
Practice 1 Practice 2 Practice 3 Practice 4 Practice 5 Practice 6
Investigate the situation, context, or task Represent algorithmic processes without using a programming language Generalize data sources through variables Explain how a code segment or program functions Explain how computing systems work Collaborate in the development of solutions
Determine and design an appropriate method or approach to achieve the purpose Implement and apply an algorithm Use abstraction to manage complexity in a program Determine the result of code segments Explain how knowledge can be generated from data Use safe and secure methods when using computing devices
Explain how collaboration affects the development of a solution Explain hoe abstraction manages complexity Identify and correct errors in algorithms and programs including error discovery through testing Describe the impact of a computing innovation Acknowledge the intellectual property of others
Evaluate solution options Describe the impact of gathering data
Evaluate the use of computing based on legal and ethical factors

AP Computer Science Principles Vocabulary & Exam References

Click Here


Below is a comprehensive list of vocabulary words every AP Computer Science Principles student should be familiar with. Did I miss a word? Please let me know...

Term Definition
a ← expression Evaluates expression and then assigns a copy of the result to the variable a.
DISPLAY(expression) Displays the value of expression, followed by a space.
INPUT() Accepts a value from the user and returns the input value.
a + b, a - b, a * b, a / b The arithmetic operators +, -, *, and / are used to perform arithmetic on a and b. For example, 17 / 5 evaluates to 3.4. The order of operations used in mathematics applies when evaluating expressions.
a MOD b Evaluates to the remainder when a is divided by b. Assume that a is an integer greater than or equal to 0 and b is an integergreater than 0. For example, 17 MOD 5 evaluates to 2. The MOD operator has the same precedence as the * and / operators.
RANDOM(a, b) Generates and returns a random integer from a to b, including a and b. Each result is equally likely to occur. For example, RANDOM(1, 3) could return 1, 2, or 3.
a = b, a ≠ b, a > b, a < b, a ≥ b, a ≤ b The relational operators =, ≠, >, <, ≥, and ≤ are used to test the relationship between two variables, expressions, or values. A comparison using relational operators evaluates to a Boolean value. For example, a = b evaluates to true if a and b are equal; otherwise it evaluates to false.
NOT condition Evaluates to true if condition is false; otherwise evaluates to false.
condition1 AND condition2 Evaluates to true if both condition1 and condition2 are true; otherwise evaluates to false.
condition1 OR condition2 Evaluates to true if condition1 is true or if condition2 is true or if both condition1 and condition2 are true; otherwise evaluates to false.
aList ← [value1, value2, value3, ...] Creates a new list that contains the values value1, value2,value3, and ... at indices 1, 2, 3, and ... respectively and assigns it to aList.
aList ← [] Creates an empty list and assigns it to aList.
aList ← bList Assigns a copy of the list bList to the list aList. For example, if bList contains [20, 40, 60], then aList will also contain [20, 40, 60] after the assignment.
aList[i] Accesses the element of aList at index i. The first element of aList is at index 1 and is accessed using the notation aList[1].
x ← aList[i] Assigns the value of aList[i] to the variable x.
aList[i] ← x Assigns the value of x to aList[i].
aList[i] ← aList[j] Assigns the value of aList[j] to aList[i].
INSERT(aList, i, value) Any values in aList at indices greater than or equal to i are shifted one position to the right. The length of the list is increased by 1, and value is placed at index i in aList.
APPEND(aList, value) The length of aList is increased by 1, and value is placed at the end of aList.
REMOVE(aList, i) Removes the item at index i in aList and shifts to the left any values at indices greater than i. The length of aList is decreased by 1.
LENGTH(aList) Evaluates to the number of elements in aList.
RETURN(expression) Returns the flow of control to the point where the procedure was called and returns the value of expression.
MOVE_FORWARD() The robot moves one square forward in the direction it is facing.
ROTATE_LEFT() The robot rotates in place 90 degrees counterclockwise (i.e., makes an in-place left turn).
ROTATE_RIGHT() The robot rotates in place 90 degrees clockwise (i.e., makes an inplace right turn).
CAN_MOVE(direction) Evaluates to true if there is an open square one square in the direction relative to where the robot is facing; otherwise evaluates to false. The value of direction can be left, right, forward, or backward.
block A piece of code that is separated from the code around it
body The code inside of a method
boolean A type of variable or operation that evaluates to true or false
braces Symbols that define the start and end of a block of code
break A statement to jump outside of a loop or conditional branch
bugs Problems that prevent code from working properly
byte Eight bits
bytecode The Java code that is ready to be processed by an interpreter
capacity The amount of space allocated for a List
case Identifies a code choice of a switch statement
cast Forcing an expression of one data type to fit into a variable with a different type
catch A keyword used to collect and handle specific types of exceptions
change Setting a part of the condition to a different value so the code doesn't loop infinitely
char A data type for holding a single letter, digit or symbol
class Code that defines the attributes and behaviors of an object
class definition All of the method headers and instance variables that make up a class
class declaration The header line of a class
class variable A variable that is shared among all instances of a class (aka static field)
client A class that uses another class
column A vertical organization of items in a 2D array, the second set of brackets
comments A written description of what code does for human readers
Comparable An interface requiring compareTo that allows built-in sort and searches to be used on a class
comparator A class implementing compare that creates a tool for sorting and searching
compare A tool that is used to check the order between two objects passed as parameters
compareTo A method that is used to check the order between an object and a single parameter
comparisons When an expression or constant is checked for a relationship with another
compatible Data types that contain similar enough values that they can be cast to each other
compiler The part of an IDE used to change turn code into software
compound A complex line of code with made of multiple expressions
compound assignment operator +=, -=, *=, /=, %=
concatenation An operation that creates a new string out of other strings by sticking them together
concrete A class that can be instantiated, a non abstract class
condition A statement that can be evaluated to determine if a piece of code will be run
conditional A statement that is dependent on an expression that evaluates to true or false
console application A piece of software that runs without a GUI
conspicuous Variable names that clearly describe the value they represent
constant A variable that cannot change once its initial value is assigned
constructor A piece of code that is run when an object is instantiated/created
contents What is inside of a data set or element
convention An agreed upon way of coding that is not required by the computer
convert Changing values of one type into another
copy constructor A special constructor that takes a parameter of the same type as the class being created
CPU The "brain" of your computer
data type The kind of information that can be held in a variable
debugger The part of an IDE that helps you find errors in your code
declaration The line where a class, method or variable is first created
decrement Decreasing a value by 1
default constructor A constructor provided by the compiler when no constructor is coded
DeMorgan's Laws Rules that describe how logical operations relate and transform into each other
derived class A class that inherits from another class (aka subclass)
digital Using whole numbers
direct manipulation interface An interface that allows the user to interact with program constructs manually
do-while A type of loop with the condition at the end that always executes at least once
document To create help files and comments to make notes for future users and editors
dot notation A way of referencing a method or variable that is part of a class
double The most common data type for decimal numbers
editor The part of an IDE used to type code
element A individual item in an array or list
empty string A string variable that has memory allocated but no text ("")
encapsulation The practice of using setters and getters to control access to private variables
equals A method that compares objects to see if they are the same
equation A mathematical statement that two expressions have the same value
evaluate Determine the current value of an expression
exception An problem that occurs while a program is running that causes it to crash
exception handling Code intended to catch runtime errors and handle them to prevent a crash
executable A file ready to be run as a program by an operating system
expression A piece of code that will be evaluated when it is run
extends A keyword that is used to cause a class to inherit from another class
false The opposite of true
field A variable created and stored at the object level (aka instance variable)
final A keyword used for creating a constant
finally A keyword that attempts to run code after an exception has happened
flowchart A graphic showing the paths that execution of a program may follow
for A type of loop with the initialization, condtion and chage built into the header. A fixed number of times loop.
for-each loop A special code block for traversing an array or list
formatting Making numbers appear in as text in a particular way
gate A component that does simple binary calculations
generic type A superclass type shared by multiple subclass types
getter A method that returns the value of a private instance variable (aka accessor)
GUI The graphical user interface for interacting with a user
hardware Physical component of a device
HAS-A A relationship between classes where one class is used by another
hierarchy A system for organizing in which each item is a superclass and/or subclass of another item
high level language A language like Java that is converted to machine code before it is executated
IDE An integrated development environment that contains the tools you need to write a program
if-else The keywords used for conditional branching
immutable A value that cannot be changed once created
implementation The final code used to solve a programming problem
implements A keyword that indicates a class will perform the job of an interface
implicit Something that is assumed to be the case if not stated otherwise
import A keyword that allows you to use code from another package in your code
increment To increase a value by a set amount
indentation Shifting code to the right to indicated that it is inside a block
index The number that represents each letter or element in a String, array or a List
IndexOutOfBoundsException An error that happens when code accesses an element in an array that doesn't exist
infinite loop A piece of code that repeats itself forever
information hiding The practice of making instance variables private to protect the internals operations of the code
inheritance When a subclass gets code and variables originally created in the parent class
initialize Allocate the memory for an array and set up beginning values
Insertion Sort A sort with O(n^2) speed that finds the correct position of each element swapping as needed
instance An object based on a class that exists when a program is running
instance variable A variable stored at the class level (aka field)
instantiate Creating and setting up and actual instance of a class to link to its variable, uses "new" keyword
int The most common data type for non decimal numbers
integer division The answer for why 7/2 is 3 and not 3.5
interface A programming construct that provides headers of required methods, but no code or variables
interpret Preparing a Java application to be run for a specific operating system
invoke A word meaning to call a method and run its code
IS-A A subclass/superclass relationship between classes
iteration One of many times executing the same piece of code
iterative statements Sections of code that repeat in a predictable order
JavaDoc A tool that creates documentation for code using comments with special syntax and keywords
JDK The Java Development Kit needed for writing Java code
key A piece of data in an object used to sort on
length The number of items in an array
length() method Used to find the number of characters in a string
literal strings Text that is written in code between quotation marks
local variable A variable created inside a method or other block of code
logic error A coding mistake that causes code to act differently than planned
logical operators Operators that combine or compare boolean expressions (eg. &&,
loop invariant A relationship between variables that is checked to determine whether to loop again
loops A ny piece of code that repeats when it reaches the end
machine code A CPU specific binary language (aka assembly code)
Mergesort A sort with O(n log n) speed that breaks the data set in half calling itself recursively
method Code that defines an ability or behavior of an object
minimized Code that takes the least space possible
modifier A method used to change the value of a private variable (aka setter, mutator)
modulus (%) An operator for finding the remainder from integer division
motherboard Computer component all other parts connect to
mutator A method used to change the value of a private variable (aka setter, modifer)
nested Code that is inside another block of code
nested loop A piece of repeating code inside another piece of repeating code
new operator A keyword used when calling the constructor for an object being instantiated
newline A character that tells the console to move the cursor to the next line
no-args constructor An empty constructor, one that takes no parameters
NOT Reverses value of the input
null A keyword meaning "has no value"
O notation A way of showing the relative theoretical speed of a search or sort algorithm
object An instance of a class that exists when a program is running
object model A planning tool used to design a class before coding it
object oriented programming A programming philosophy in which code is written to represent real world things or ideas
OR True if any input is true
order of operators The rules that determine how the computer chooses which operations are evaluated first
overloaded When a method is written in different ways with two or more possible parameter sets
package A collection of java classes
parameter A variable whose value or reference is passed into a method
parse Move through a string one letter or word at a time
partitioning The process of breaking a set into two or more pieces
pass by reference When a parameter is sent as a memory location
pass by value When a parameter is sent as data
pattern recognition The ability to recognize a form of organization in a data set
peripheral Computer part not inside the chassis
pivot A value in a set used to split the set into two parts on which the data will be sorted
polymorphism The concept that a single named behavior can be performed differently by various subclasses
primitive type One of the built-in non-object data types that is stored by value
printf A special method for Strings that includes formatting characters in the string literal
private A keyword that makes a variable or method accessible from only inside the class
procedural language A language where programs are expected to operate in a predictable order
pseudocode A way of designing a program using written descriptions of what the code will be
public A keyword that makes a variable or method accessible from outside the class
Quicksort A sort with O(n log n) speed that splits the data using a randomly chosen pivot
RAM Computer component that stores currently in-use data
readability A measure of how easily something is understood by others
recursive A piece of code that uses itself to solve the problem
redundancy Allows a something to be understood even if some of it is missing or wrong
reference An address that holds the memory location of the variable's data
regular expression A predefined set of codes for limiting parse and search type String operations
relational operators Operators that compare two expressions (eg. <>, !=, ==)
remove A method for taking an item out of a list and filling any gap
reserved word Special words used by the Java language that cannot be used for naming
return A statement that causes a method to end and may send back a value to the calling code
return type The kind of data that will be sent back by a method
row A horizontal section of a 2D array, the first set of square brackets
scope The part of code in which a variable exists or is accessible
search Finding a particular item in a list, array or other collection
Selection Sort A sort with O(n^2) speed that checks each element against every other element
Sequential Search A search that checks each element from beginning to end
set A method for changing the value of an item in a list
setter A method that is used to change the value of a private variable (aka modifier)
short-circuit evaluation A chain of relational or conditional expressions that stops evaluating as soon as the result is known
signature The header line of a method that defines its return type, name and parameter list
size The number of items in an ArrayList
software engineering Planning, designing, building and testing computer programs
sorting Putting a collection of data in order
source code The original code created by the programmer
square brackets Used to create arrays and refer to a specific element
stack T he part of the computer that keeps track currently running layers of code
statement A complete and syntactically correct line of code
static field A variable that is shared among all instances of a class (aka class variable)
static method A method that uses no (non-static) instance variables and can be called without an instance of the class
String A built-in class for holding words, sentences, parahraphes, etc.
style The conventions agreed upon by programmers for how to write code to be understood by others
subclass A class that inherits from another class
subinterface An interface that inherits from another interface
subscript A way of writing an index to an array in pseudocode
substring A part of a text value
super A keyword that is used to access methods and fields from a base class
superclass A class that another class inherits from (aka base class)
superinterface An interface that another interface inherits from
switch A keyword that chooses what code to run based on a single value
symbolic A name that represents another value
syntax The rules for how code must be entered to compile and work
syntax error A coding mistake that prevents code from compiling
testing Checking the condition on a piece of code
this A keyword that refers to the current instance of the class
transistor A tiny on-off switch
transmission Moving something from one place to another
traversal The process of interacting with each element in an array or list in order
true The opposite of false
try A keyword that begins a block code that could cause an exception
Two-Dimensional Array An array of arrays
uninitialized string A string variable that is named but has nowhere to store its data
value Data represented by a variable or expression
variable A named value in a program that can contain a specific type of data
visual prototyping and design tools Tools that allow an engineer to plan their software through drawings and flow models
while A type of loop that runs as long as its condition is true
whitespace Any space, tab or new line charcter in the code
wrapper class A class designed to add behaviors to a primitive type

Academic Integrity

Click to Open

This is a reminder that each student is responsible for their own work. Assignments that are designated as team/ group assignments must have each students name within the block header. Other assignments students may collaborate with another student, but each student must submit their own work and the assignment cannot be a facsimile of their peers work. Submitted assignments that has another student's name on it and not your name will be considered as cheating and subject to the schools policy regarding plagiarism/ cheating. Furthermore, assignments that have been deemed as plagirised will receive a '0' on the assignment.

If you have any questions, please contact me.

Python Style Guidelines

Click Here


https://peps.python.org/pep-0008/

https://docs.python-guide.org/writing/style/

https://vinayak-hegde.medium.com/a-comprehensive-style-guide-for-python-enhancing-readability-and-maintainability-5f893bdae85a

https://courses.cs.washington.edu/courses/cse160/18sp/computing/style_guide.html

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages