Program Function and Purpose (College Board AP® Computer Science Principles): Exam Questions

10 mins10 questions
1
1 point

A program lets users design and share their own digital artwork. Which purpose category does this best fit?

  • Solving a problem

  • Creative expression

  • Exploring a topic

  • Data storage

2
1 point

Which statement best describes the difference between a program's purpose and its function?

  • The purpose and the function always mean exactly the same thing

  • The purpose is what the program does; the function is why it exists

  • The purpose is why the program exists; the function is what it does

  • The purpose is the program's code; the function is its comments

3
1 point

A mobile app lets farmers log daily rainfall and then recommends the best day to plant their crops. What is the primary purpose of this innovation?

  • Entertainment

  • Creative expression

  • Exploring a topic

  • Solving a problem

4
1 point

A group of statements that work together to complete part of a task is best described as a:

  • Code segment

  • Statement

  • Program

  • Variable

5
1 point

By default, in what order does a program carry out its statements?

  • All at the same time

  • Sequentially, from top to bottom, one at a time

  • In a random order each run

  • From the bottom of the program upward

6
1 point

Consider the following code segment.

price ← 100
price ← price - 20
price ← price * 2
DISPLAY(price)

What value is displayed?

  • 80

  • 180

  • 160

  • 200

7
1 point

Why can the same program produce different outputs on different runs?

  • Because its comments change between runs

  • Because its statements run in a different order each time

  • Because the program rewrites its own code as it runs

  • Because it can receive different inputs

8
1 point

A program accepts a quantity of items from 1 to 50. Which input is an edge case?

  • 50

  • 25

  • 75

  • "apple"

9
1 point

A program calculates the shipping cost for packages weighing between 0.1 kg and 30 kg. Which two inputs best test that it handles the boundary conditions? Select two answers.

  • 15 kg

  • 12 kg

  • 0.1 kg

  • 30 kg

10
1 point

A program takes a list of exam scores as input and displays the single highest score. Which of the following best describes the behavior of this program?

  • It creates a variable and compares each element of the list in turn using conditional statements

  • It receives a list of scores as input and outputs the highest value in that list

  • It exists to help teachers record and rank student grades more quickly

  • It always returns a correct result, even when the input list is empty