Program Function and Purpose MCQ Practice

Question 1 of 10

A program named LaneAlert beeps when a bicycle approaches a blind driveway. Sensors report distance; speakers play a tone; a light on the mailbox flashes.

Which statement best describes the program's purpose?

  1. A. To warn people near the driveway that a bicycle is approaching.
  2. B. To grade AP CSP free-response answers automatically.
  3. C. To replace the bicycle's brakes with software.
  4. D. To encrypt driveway ownership records for the city assessor.

Question 2 of 10

Consider this CSP pseudocode for a snack-machine change helper:

price ← INPUT()
paid ← INPUT()
DISPLAY(paid - price)

A tester enters price 1.25 and paid 2.00. What does the program communicate to the user, and what is its purpose?

  1. A. It displays nothing; purpose is only to store prices silently.
  2. B. It displays 0.75; purpose is to show how much change is due.
  3. C. It displays 3.25; purpose is to total all snacks sold today.
  4. D. It displays 1.25; purpose is to lock the machine door.

Question 3 of 10

A classroom plant-monitor app lists these behaviors:

Behavior Trigger
Log soil moisture Every 10 minutes
Send dry-soil text Moisture below 20
Show weekly chart User taps History
Mute alerts User taps Mute

Which behavior is best classified as an event-driven response to a user action rather than a timed or sensor-threshold action?

  1. A. Log soil moisture
  2. B. Send dry-soil text
  3. C. Show weekly chart
  4. D. None of the behaviors involve users

Question 4 of 10

A librarian asks for software that "helps students find quiet study rooms." Three proposals arrive:

Proposal What it actually does
A Counts books checked out per hour
B Maps open rooms and noise sensor readings
C Prints late-fee invoices
D Schedules staff lunch breaks

Which proposal's function best matches the stated purpose?

  1. A. C
  2. B. D
  3. C. A
  4. D. B

Question 5 of 10

A fitness club desk tablet runs CheckIn. Members tap their ID; the screen shows "Welcome" or "Expired membership."

Which pair correctly identifies an input and an output of CheckIn?

  1. A. Input: member ID tap; Output: Welcome or Expired message
  2. B. Input: Expired message; Output: desk tablet hardware
  3. C. Input: fitness club building; Output: electricity
  4. D. Input: Welcome message; Output: member ID tap

Question 6 of 10

This program fragment runs when a user presses Start on a baking timer:

minutes ← INPUT()
secondsLeft ← minutes * 60
REPEAT UNTIL secondsLeft = 0
{
    secondsLeft ← secondsLeft - 1
}
DISPLAY("Done")

Which statement best describes what the user experiences as the program's purpose in use?

  1. A. It immediately prints the recipe ingredients list.
  2. B. It waits for the entered number of minutes (counting seconds down) and then displays Done.
  3. C. It encrypts the kitchen Wi-Fi password.
  4. D. It randomly picks a dessert from a list forever.

Question 7 of 10

A city posts two apps. App P lets residents report potholes with a photo and street pin. App Q generates payroll for city employees.

A resident says, "I need something that helps me tell the city where the road is damaged." Which app's purpose matches, and why?

  1. A. Both equally, because any city software serves residents the same way.
  2. B. App Q, because payroll systems store street names.
  3. C. App P, because its function is collecting resident damage reports with location.
  4. D. Neither, because purpose can never be inferred from functions.

Question 8 of 10

An online art portfolio site includes a button labeled Share. Pressing it copies a link and shows "Link copied."

Which description of program purpose is most accurate for the Share feature?

  1. A. To grade the artwork's creativity score.
  2. B. To force all visitors to purchase prints.
  3. C. To permanently delete the artwork from the server.
  4. D. To help the user distribute access to the artwork via a link.

Question 9 of 10

Which question is most useful when identifying a program's purpose from its code and interface?

  1. A. What user need or task do the inputs, processes, and outputs work together to support?
  2. B. Which programming language keyword appears most often?
  3. C. What is the file size on disk?
  4. D. How many lines of code does it contain?

Question 10 of 10

A kiosk program for museum tickets does the following in order: reads group size, reads student/adult counts, computes price, prints a QR code, and opens the gate motor for 5 seconds after a valid scan.

A visitor claims the program's only purpose is printing QR codes. Why is that claim incomplete?

  1. A. Because motors cannot be controlled by programs.
  2. B. Because computing price and controlling the gate are also part of fulfilling ticketed entry.
  3. C. Because QR codes are never outputs.
  4. D. Because group size cannot be an input.