Ap comp sci unti 1 test

0.0(0)
studied byStudied by 6 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/31

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

32 Terms

1
New cards

Code

giving comands to a computer

2
New cards

function

code that breaks a program into smaller parts, makes the program easier to understand, and allows the avoidance of repeating code over and over. A function name is all lower case, words are separated with a underscore, and the name should start with an action verb.

3
New cards

Precondition

what must be true before a function is called

4
New cards

postcondition

what should be true after a function is called

5
New cards

Decomposition

breaking code down into smaller parts that are easy to understand

6
New cards

Top down desgin

breaking down a problem into smaller problems

7
New cards

comment

text used to help another reader understand the code in a program
ex For a single line # Comment, For multiple lines: ““Comment””

8
New cards

Abstraction

to reduce complexity
ex: creating a function

9
New cards

API (application programming interface)

a set of tool for building software (program)
Ex Python

10
New cards

Bug

a mistake in a program

11
New cards

Conditional

a statement that returns a true or false answer

12
New cards

Syntax

the rules of programming language

13
New cards

Debugging

searching for syntax error

14
New cards

Algorithm

a step by step set of instructions to solve a problem

15
New cards

iteration

a specific number of repetitions

16
New cards

Program Quality

the quality of a program is based on its level of efficiency and clarity

17
New cards

Pseudocode

writing out our agorithm in english-like code to help us figure out how to write the program

18
New cards

Parameter

an input into function We can pass a parameter to a function to make it do specific things

19
New cards

Control Structures

a control structure is a block of code that determines the flow of execution based on ceratin conditions
Ex if statments, if-else statement, for loop and whilel loop.

20
New cards

def move_twice():
move()
move()

defines a function called move_twice. This function willl make Karel move forward two times. Don’t forget the colon “:” at the end.

21
New cards

for i in range(5):

creates a loop that goes through 5 iterations of a specific sequence of code. Don’t forget the colon “:” at the end

22
New cards

Abstractions

Managing complexity by 'abstracting away' information and detail, to focus on the relevant concepts 

High level of abstraction, few words/short sentence 

Low Level of abstraction, very detailed and longer

23
New cards

Documentation

provides information to show programmers how to use it

24
New cards

For Loops

The For Loop lets karel repeat a secretion of code fixed number of times

For Loop=repeat a fixed number of times

All programming languages have for loops

25
New cards

If/Else Statements

To do something if a condition is true and do something else if the condition is false

26
New cards

While Loops

While loops allow us to repeat a section of code as long as some condition is true

While Loops=repeat as long as conditions is true

27
New cards

Control structures

Control the flow of the program; how the commands execute.
If statement

If-Else statement

Repeat Code

For Loop

While Loops

28
New cards

Syntax error

Program does not start running

29
New cards

Runtime error

Program starts running, but crashes when running

30
New cards

Logic error

Program starts running, but does not do what it is supposed to do

31
New cards

Sequencing

Step-by-step execution of instructions under the orders that they are given

32
New cards

Selection

Using a condition to determine which part of the algorithm is executedÂ