AP Comp (POP Quiz)

Quiz
•
Computers
•
9th - 12th Grade
•
Medium
Carlita Scarboro-Vazquez
Used 2+ times
FREE Resource
7 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
2 mins • 10 pts
In the following procedure, the parameter max is a positive integer.
PROCEDURE printNums(max)
{
count ← 1
REPEAT UNTIL(count > max)
{
DISPLAY(count)
count ← count + 2
}
}
Which of the following is the most appropriate documentation to appear with the printNums procedure?
Prints all positive even integers that are less than or equal to max.
Prints all positive odd integers that are less than or equal to max.
Prints all positive even integers that are greater than max.
Prints all positive odd integers that are greater than max.
2.
MULTIPLE CHOICE QUESTION
2 mins • 10 pts
In the following procedure, the parameters x and y are integers.
Which of the following is the most appropriate documentation to appear with the calculate procedure?
Which of the following is the most appropriate documentation to appear with the calculate procedure?
Responses
Displays the value of x + (y / x).The value of the parameter x must not be 0.
Displays the value of x + (y / x).The value of the parameter y must not be 0.
Displays the value of (x + y) / x.The value of the parameter x must not be 0.
Displays the value of (x + y) / x.The sum of the parameters x and y must not be 0.
Answer explanation
Answer C
Correct. The code segment first adds the values of x and y, then divides the sum by x, then prints the result. The value of x must not be 0; otherwise a divide-by-zero error will occur when result is divided by x.
3.
MULTIPLE CHOICE QUESTION
2 mins • 10 pts
In the following procedure, the parameter numList is a list of numbers and the parameters j and k are integers.
PROCEDURE swapListElements(numList, j, k)
{
newList ← numList
newList[j] ← numList[k]
newList[k] ← numList[j]
RETURN(newList)
}
Which of the following is the most appropriate documentation to appear with the swapListElements procedure?
Returns a copy of numList with the elements at indices j and k interchanged.The value of j must be between 0 and the value of k, inclusive.
Returns a copy of numList with the elements at indices j and k interchanged.The values of j and k must both be between 1 and LENGTH(numList), inclusive.
Interchanges the values of the parameters j and k.The value of j must be between 0 and the value of k, inclusive.
Interchanges the values of the parameters j and k.The values of j and k must both be between 1 and LENGTH(numList), inclusive.
Answer explanation
Answer B
Correct. The procedure creates a copy of numList called newList. The element at newList[j] is assigned the element at numList[k], and the element at newList[k] is assigned the element at numList[j]. Therefore, the difference between numList and newList is that the elements at indices j and k are interchanged. The procedure only works if j and k are valid list indices, so it is important to document that j and k are both between 1 and LENGTH(numList), inclusive.
4.
FILL IN THE BLANK QUESTION
30 sec • 5 pts
To _______ strings means to make a bigger string by connecting two or more smaller strings.
5.
FILL IN THE BLANK QUESTION
1 min • 5 pts
An _______ is a sequence of steps that are usually performed by a computer.
6.
FILL IN THE BLANK QUESTION
1 min • 5 pts
Some people call an algorithm written in human language _______ .
7.
FILL IN THE BLANK QUESTION
1 min • 5 pts
Computer scientists describe a repeating program structure as looping, repetition, or _________ .
Similar Resources on Wayground
10 questions
Programming basics

Quiz
•
9th - 12th Grade
5 questions
5_Arrays — Bubble Sort

Quiz
•
10th - 11th Grade
11 questions
JavaScript Control Structures Basic

Quiz
•
12th Grade
6 questions
Tipul de date enumerare

Quiz
•
9th - 10th Grade
10 questions
פירוק והרכבת מספר

Quiz
•
10th Grade
9 questions
AP Computer Science Principles Session 2 – MCQ

Quiz
•
10th Grade
10 questions
DFD- DIAGRAMAS DE FLUJO

Quiz
•
10th Grade
10 questions
MIT App Inventor Basics

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
10 questions
1.2 OSI & TCP IP Models Quiz

Quiz
•
10th Grade
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
30 questions
Introduction to Computers

Quiz
•
8th - 9th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
20 questions
Hardware vs. Software Quiz

Quiz
•
7th - 10th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade