Comp Sci unit 3 #8
Quiz
•
Computers
•
11th Grade
•
Practice Problem
•
Easy
Nick Nessralla
Used 11+ times
FREE Resource
Enhance your content in a minute
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
An algorithm is intended to display the following output.
red red blue red red blue red red blue
Which of the following code segments can be used to display the intended output?
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A flowchart provides a way to visually represent an algorithm and uses the following building blocks.
BlockExplanationOvalThe start or end of the algorithmRectangleOne or more processing steps, such as a statement that assigns a value to a variableDiamondA conditional or decision step, where execution proceeds to the side labeled true if the condition is true and to the side labeled false otherwiseParallelogramDisplays a message
In the flowchart below, assume that j and k are assigned integer values.
Which of the following initial values of j and k will cause the algorithm represented in the flowchart to result in an infinite loop?
j = -5, k = 5
j = 0, k = 5
j = 5, k = 0
j = 5, k = -5
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following program.
Which of the following describes the result of executing the program?
The program displays the sum of the even integers from 2 to 10.
The program displays the sum of the even integers from 2 to 20.
The program displays the sum of the odd integers from 1 to 9.
The program displays the sum of the odd integers from 1 to 19.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The code segment below is intended to display all multiples of 5 between the values start and end, inclusive. For example, if start has the value 35 and end has the value 50 , the code segment should display the values 35,40 45, , and 50. Assume that start and end are multiples of 5 and that start is less thanend .
Which of the following could replace <Missing Expression> in line 2 so that the code segment works as intended?
5.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
The following code segment is intended to remove all duplicate elements in the list myList. The procedure does not work as intended.
j ← LENGTH(myList)
REPEAT UNTIL(j = 1)
{
IF(myList[j] = myList[j - 1])
{
REMOVE(myList, j)
}
j ← j - 1
}
For which of the following contents of myList will the procedure NOT produce the intended results?
Select two answers.
[10, 10, 20, 20, 10, 10]
[30, 30, 30, 10, 20, 20]
[30, 50, 40, 10, 20, 40]
[50, 50, 50, 50, 50, 50]
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A biologist wrote a program to simulate the population of a sample of bacteria. The program uses the following procedures.
Code for the simulation is shown below.
hours ← 0
startPop ← InitialPopulation ()
currentPop ← startPop
REPEAT UNTIL ((hours ≥ 24) OR (currentPop ≤ 0))
{
currentPop ← NextPopulation (currentPop)
hours ← hours + 1
}
DISPLAY (currentPop - startPop)
Which of the following are true statements about the simulation?
-The simulation continues until either 24 hours pass or the population reaches 0.
-The simulation displays the average change in population per hour over the course of the simulation.
-The simulation displays the total population at the end of the simulation.
I only
II only
III only
I and II
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following program code.
Which of the following best describes the result of running the program code?
The number 0 is displayed.
The number 6 is displayed.
The number 10 is displayed.
Nothing is displayed; the program results in an infinite loop.
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
11 questions
Programming Quiz 1
Quiz
•
11th Grade
10 questions
PERFORMING COMPUTER OPERATIONS
Quiz
•
11th Grade
15 questions
Imaging and Design
Quiz
•
11th - 12th Grade
10 questions
ICT as Platform for Change
Quiz
•
11th - 12th Grade
10 questions
MS word
Quiz
•
11th Grade
10 questions
Visual Basic 2010
Quiz
•
8th Grade - University
11 questions
Types of Mass Media
Quiz
•
10th Grade - Professi...
11 questions
Programming basics
Quiz
•
10th - 11th Grade
Popular Resources on Wayground
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
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
