Title | AP Computer Science Principles Unit 2 Notes |
---|---|
Author | Anonymous User |
Course | Programming & Logic I |
Institution | Hudson Valley Community College |
Pages | 7 |
File Size | 138.5 KB |
File Type | |
Total Downloads | 81 |
Total Views | 170 |
The unit 2 notes compiled from all of the lessons on the Project Stem Advanced Placement Computer Science Principles course in high school....
Claudia Consiglio Mr. Baxter APCSP Unit 2 Notes
2.1
Algorithm- a process or set of rules to be followed in calculations or other problems solving operations
Sequencing- logic structure where instructions are executed in order, one after another, one at a time. Often called linear.
Flowchart- a simple diagram with symbols showing the "flow" of a process
Flow pattern- pattern that can emerge when data is transformed using computational logic structures (sequencing, selection, iteration).
Sequential execution- program instructions that are executed one at a time, in specific order.
A computer can only do what it is programmed to do.
Scratch uses a lot of sequencing because we have to place blocks one-at-a-time in order.
Sprite’s state: its location and/or orientation
Code segment- refers to a collection of program statements that are part of a program.
Program- a collection of program statements that performs a specific task when run by a
2.2
computer. A program is often referred to as software.
Parameter- a variable that defines a procedure or sets the conditions of an operation
Procedure- a named collection of steps in an algorithm that can be reused anytime it is needed without restating the detailed procedures (abstraction)
Comments- an annotation in the code of a computer program
Remix- to modify and share a version of an uploaded existing project
Pseudocode is an efficient way to show your algorithms.
It is concise and to be precise: regular text can get too wordy and abbreviations can leave
2.3
out important info.
Want to get to a high-level of extraction: pseudocode.
A MOD b = remainder of division problem
Most programming languages follow PEMDAS for order of operations.
Pseudocode- an informal method of writing algorithmic instructions that do not necessarily follow grammatical rules and syntax of a particular language. "False" code.
2.4
Selection: if…then
Sometimes there is a condition that needs to be checked before moving on to the next step.
Pseudocode doesn’t say THEN, instead uses { }
There is also if…else: condition is met or is not met.
-Sometimes there needs to be more that 1 possibility in statements with comparisons: if...else…if…else. -Shrink it down to one comparison.
Operators (text-based) Operator
>
Meaning Greater than
<
Less than
>=
Greater than or equal to...