Comp Sci unit 3 #8

Quiz
•
Computers
•
11th Grade
•
Easy
Nick Nessralla
Used 11+ times
FREE Resource
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.
Create a free account and access millions of resources
Similar Resources on Wayground
14 questions
GCSE Computing Low & High Level Languages/IDE's

Quiz
•
10th - 11th Grade
13 questions
2.5 Translators & Facilities - OCR GCSE Computer Science

Quiz
•
7th - 12th Grade
10 questions
AP CSP Big Idea 3 Practice

Quiz
•
9th - 12th Grade
8 questions
Robotics Quiz

Quiz
•
1st - 12th Grade
10 questions
Introduction to Arrays

Quiz
•
KG - University
10 questions
Flowcharting

Quiz
•
6th - 11th Grade
12 questions
CodeHS Unit 1

Quiz
•
9th - 12th Grade
10 questions
U5L13 - Pseudocode Homework (Conditionals & Loops)

Quiz
•
10th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

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

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade