Search Header Logo
AP CSP - UNIT 1 - REVIEW

AP CSP - UNIT 1 - REVIEW

Assessment

Presentation

Instructional Technology

9th Grade

Practice Problem

Medium

Created by

Klea h

Used 5+ times

FREE Resource

12 Slides • 12 Questions

1

AP CSP - CHAPTER 1

By Klea h

2

​1.1 The Iterative Development Process

Creating a program is similar to the scientific method—you start with a problem, investigate, test, and improve.

A development process is incremental, so it breaks the problem into smaller pieces and makes sure each piece works before adding it to the whole.

The Iterative Development Process explains how an idea becomes a useful program. It is a process where ideas are repeatedly improved based on feedback and testing. It is ordered and intentional. This process is a cycle(iterative), which means to repeat a process, getting a slightly different (hopefully better) result each time.

At the end, programmers take what they learned from testing and feedback and use it to create, design and implement new ideas to make improvements.

3

media

4

​Key Vocabulary

  • Innovating: Creating new ideas and turning them into real solutions

  • Iterative Development: Designing and improving a program through cycles of testing and feedback

  • Debug: Finding and fixing errors in a program






Final Takeaway

The best programs aren’t written in one
try—they are built through testing, feedback,
and improvement. Think before coding,
plan carefully, and keep improving!

media

5

Multiple Choice

A program that Thomas has written is complete. It has been tested thoroughly, and some outputs were not as expected. Thomas is now going through the code carefully attempting to establish the cause of these errors and change the code to remove them. What is this procedure called?

1
Debugging
2

Developing

3

Error Check

4

Coding

6

Multiple Choice

Understanding of the life cycle of a program is an essential component to becoming an effective programmer. Which of the following is the best example of how the life cycle of a program should work?

1

 

Idea→write code→algorithm→execute code→debug→maintain

2

 

Idea→algorithm→write code→execute code→debug→maintain

3

 

Idea→algorithm→write code→execute code→maintain→debug

4

 

Idea→algorithm→write code→debug→execute code→maintain

7

Multiple Choice

Jeremiah is part of a group planning a summer fair at which local businesses can run stalls and events. He wants to use his programming skills to develop an app for the fair which businesses will be able to use to communicate information about their activities at the fair with visitors. Which of the following would be the best first step for Jeremiah to take?

1

 

Write some sample code to understand how the app might work

2

 

Develop all of the major algorithms which will be required for the app by drawing flowchart representations

3

 

Find out from the businesses and potential visitors what information and format they think should be used for the app

4

 

Write thorough documentation explaining how the code for the app works

8

What is an algorithm? Set of step by step instructions to accomplish a task or resolve a problem.

Why are algorithms important?
1. They are tools for problem solving.
2. They help us find an efficient step-by-step process for a working solution.
3. They provide an outline for HOW to write code for a specific program.
4. They help us construct and express a detailed sequence of operations that harness computing power.

What is Algorithmic Thinking? (Learning to think with logical steps)

The process behind:
● Organizing complex thoughts in a logical and structured order.
● Constructing a conceptual solution that can be implemented.



How Algorithms Are Constructed?
Most algorithms are composed of familiar patterns that control the flow of execution for instructions: sequencing, selection, and iteration.

1.2: ALGORITHMS

9

  • Sequencing: Executes statements one at a time (often called linear).

  • Selection: Uses “if…then” to tell computer how to select a step or to tell the sequence that should be executed.

  • Iteration: Uses repetition (loops) – repeating actions until a certain condition is met.


WRITING THE BEST ALGORITHMS: Well-written algorithms are specific and precise.

media

Key Features of Algorithms
1. Clear Format: Each step should be easy to see.
2. Imperative statements: written with a verb phrase Example: “put on,” “move forward,” etc.
3. Descriptive qualifiers: contains detailed instructions. Example: "Put on the shoe" - Say “left shoe” instead of “shoe.”

What information should algorithms include? Only necessary instructions that are accurate.

Basic Algorithms --> • Recipes • Sorting laundry • Putting things in alphabetical order • Solving a Rubik’s cube

10

Multiple Choice

Consider the following two implementations of the same algorithm, each written in a different language.

Language A:
Calculate the average daily rainfall for the week (averageRainfall) by adding together the rainfall totals for each of the 7 days of the week (sun, mon, tue, wed, thu, fri, and sat) and dividing the sum by 7.

Language B:
Take the total amount of rain from each day of the week (sunday, monday, tuesday, wednesday, thursday, friday and saturday) and then average them together to get the average daily rainfall for the week (averageRainfall).

Which of the following statements about these two implementations is true?

1

Language B is ambiguous because the process of “average” is not explained well

2

Language A is ambiguous because it is unclear what sun, mon, tue, wed, thu, fri, and sat refer to in context with the problem.

3

The algorithms in both languages are ambiguous because they do not specify the actual values of the seven daily rainfall totals.

4

Neither of these languages is clear enough that a programmer could write a correct solution in a high-level programming language.

11

Multiple Choice

Question image

The algorithm below simulates rolling a regular 6-sided die twice. Consider the goal of determining if the sum of the values of the two rolls is odd or even.

 

What conclusions can be made with regard to what we are trying to determine? Select two answers:

Correct Answer

1

If the value found in step 6 is 10, 20, 30, 40, 50 or 60 then the sum is even

2

If the value found in step 6 is not 20, 40, 60, 80, 100 or 120 then the sum is odd

3

 

If the value found in step 6 is 10, 30 or 50 then the sum is odd

4

If the last digit of the value found in step 6 is 5, then the sum is odd

12

Multiple Choice

Which of the following should be true of any algorithm?

I. The order in which the steps making up the algorithm are followed is logically determined
II. Following the instructions in the algorithm will always result in the same outputs, regardless of any inputs
III. The instructions in the algorithm contain all necessary information to be implemented

1
I and III are true.
2

I is true.

3

I, II, III are true.

4

II, and III is true.

13

​1.3 Languages

A language (in comp science) is a vocabulary and set of grammatical rules for instructing a computer or computing device to perform specific tasks. In the programming process, languages are used to write code.

Natural Languages

  • These are everyday languages like English, Spanish, or Chinese.

  • They are used in both spoken and written form.

  • Natural languages can be unclear or confusing because of things like slang, tone, or multiple meanings, so they are not good for writing computer programs.

Artificial Programming Languages

  • These are special languages made for a specific purpose, like telling a computer what to do.

  • Examples include Python, Scratch, and C++.

  • They are designed to be clear and unambiguous, so the computer understands exactly what you mean.

  • They use keywords, numbers, and punctuation in a structured way.

14

​Language Hierarchy: Languages are divided on how well they work for humans vs. computers:

Type

Description

Natural Language

Best for people (e.g., English), but too confusing for computers

High-Level Language

Easy for people to read and write, like Python or Scratch

Low-Level Language

Closer to what computers understand, but harder for people to read

Machine Language

Just 1s and 0s, works only for computers — very hard for humans



Key Takeaway

  • Programming languages are made to be precise and clear, so both humans and machines can work together.

  • The closer a language is to binary (machine code), the harder it is for people to use—but the easier it is for the computer to understand.

  • High level code is translated into machine code using a compiler, so that it makes sense to the pc's processor.

15

Multiple Choice

Which of the following is the MOST important reason computers use artificial languages over natural language?

1

The syntax of artificial languages is explicit and unambiguous

2

The meaning of different characters and words in an artificial languages is explicit and unambiguous

3

The meaning of different characters and words in an artificial languages is too complicated

4

The syntax of natural languages is easy to translate by computers

16

Multiple Choice

Which of the following best describes high-level computing languages?

1

They are not ambiguous

2

They evolve naturally over time

3

They are made to be parsed easily by machines

4

They are extremely difficult for humans to read and understand

17

media

18

media

19

media

20

Dropdown

The physical parts of a computer are called ​
, while the programs it runs are known as ​
. Inside the computer, the part that processes instructions and manage tasks is the ​
. Nowadays, they are smaller and known as ​

21

Multiple Choice

A type of memory that can hold data for long periods of time, even when there is no power to the computer, is called ___________.

1

RAM

2

Optical Disk

3

Secondary Storage

4

CPU storage

22



1.8 Defining Variables





A variable is like a labeled container that holds a value (like a number, word, or list). The value can change while the program runs — for example, when a user fills out a form.

Creating and Using Variables

  • Declaring a variable means creating it in code. Initializing means assigning a value to it.

  • Some languages (Python) let you use a variable without declaring its type, while other languages (Java or C++) require you to specify the data type.

  • A variable can only hold one type of value. For example, variable int age cannot hold value 2.4.

  • Variable names can’t start with numbers and can’t use reserved words (like if, print, else etc.).

media

23

Multiple Choice

Which of the following is a reason for the importance of variables in programming?

1

 

Variables allow you to change a value used in multiple places in a program easily.

2

 

All of these

3

Variables assist in making code more readable.

4

Variables allow you to store values calculated by the program and access them at a later point in the program.

24

Multiple Choice

Question image

Which of the following statements best describes the predictability of the results when this algorithm is run on a computer?

1

The answer displayed by the algorithm for any known value of n can always be predicted.

2

The algorithm always displays the same answer, regardless of the value of n.

3

The answer displayed by the algorithm can be predicted for some values of n, but not for others.

4

It is impossible to predict the value of the answer displayed, even if the value of n is known.

pattern-tertiary

AP CSP - CHAPTER 1

By Klea h

Show answer

Auto Play

Slide 1 / 24

SLIDE