
Pseudocode Quiz
Authored by John Streety
Computers
10th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the pseudocode procedure findMaxDigit, which is intended to return the maximum digit in the integer num. For example, if num is 294, findMaxDigit returns 9 because 9 is the maximum digit in 294. // precondition: num is a positive integer greater than 0 int findMaxDigit (int num) int maxDigit ← /* missing code segment */ while (num > 0) int digit ← num % 10 if ( digit > maxDigit ) maxDigit ← digit end if num ← num / 10 //Division symbol uses integer division end while return maxDigit end findMaxDigit Which of the following could replace /* missing code segment */ so that findMaxDigit works as intended?
num / 10 + 10
num % 10
num * 10
num + 10
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following function: void drawTriangle () // print a line break after each print statement print "*" print "**" print "***" print "****" end drawTriangle What would happen as a result of calling drawTriangle()?
**********
* ** *** ****
*
****
**
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following pseudocode procedure. // precondition: k is a positive integer greater than 1 void mystery(int k) for (int c = 1; c < k; c = c + 1) print c + " " end for end mystery Which of the following best describes procedure mystery?
It returns all the values from 1 to k.
It returns all the values from 1 to k-1.
It prints all the values from 1 to k.
It prints all the values from 1 to k - 1.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following procedure and procedure call: void practice( int Y) int X ← 10 Y ← Y + 5 if ( X > Y) print “Hello” else print “world” end if end practice practice(5) What would print as a result of executing the code?
Nothing because the function is defined as VOID
Hello
Hello world
world
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following procedure header: int getSum(int num1, int num2, int num3) Which procedure call is valid?
getSum("A", 96, 95)
getSum(94.5, 96, 95)
getSum(96, 95)
getSum(getSum(92, 93, 95), 96, 95)
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the pseudocode procedure swapValues that is intended to swap the values of the two integer variables m and n. void swapValues( int m, int n) /* missing code segment */ end swapValues Which of the following could replace /* missing code segment */ so that swapValues works as intended?
int temp ← m n ← m m ← n
int temp ← m m ← n n ← temp
int temp ← n m ← n n ← temp
int temp ← n n ← m m ← n
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following pseudocode procedure and procedure call: void practicePassing( pass-by-reference int X, pass-by-value int Y) Y = X / 2 // Division symbol uses integer division X = Y + 3 print X, Y end practicePassing Int i = 2 Int j = 3 practicePassing( i, j) print i, j What would print as a result of executing the code?
4 1 4 3
4 1 2 3
6 1 6 3
4 1 2 1
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
Repaso Integral de Contenidos. Proyectos
Quiz
•
2nd - 10th Grade
10 questions
Internet seguro
Quiz
•
8th Grade - University
15 questions
Historia de la Computación 10°A°
Quiz
•
10th Grade
10 questions
Virus Informáticos
Quiz
•
1st - 10th Grade
10 questions
python-BTxâu
Quiz
•
9th - 12th Grade
9 questions
Los periféricos del computador
Quiz
•
1st Grade - Professio...
13 questions
Componentes
Quiz
•
7th - 11th Grade
10 questions
TIN 10 - LẦN 1 - STVB 1
Quiz
•
10th Grade
Popular Resources on Wayground
7 questions
History of Valentine's Day
Interactive video
•
4th Grade
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
15 questions
Valentine's Day Trivia
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
Discover more resources for Computers
10 questions
Exploring Valentine's Day with Charlie Brown
Interactive video
•
6th - 10th Grade
18 questions
Valentines Day Trivia
Quiz
•
3rd Grade - University
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
10 questions
Valentine's Day History and Traditions
Interactive video
•
6th - 10th Grade
21 questions
Presidents Day Trivia
Quiz
•
6th - 12th Grade
10 questions
Valentine's Day: History and Modern Celebration
Interactive video
•
9th - 12th Grade
11 questions
Valentine's Day Trivia
Quiz
•
8th - 12th Grade
10 questions
Factor Quadratic Expressions with Various Coefficients
Quiz
•
9th - 12th Grade