
Csp4

Quiz
β’
Computers, Science
β’
3rd Grade
β’
Hard
Cherry Yu
Used 20+ times
FREE Resource
86 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec β’ 1 pt
Which of the following algorithms displays the correct distance for all possible values of num1 and num2 ?
Step 1:
Add num1 and num2 and store the result in the variable sum.
Step 2: Take the absolute value ofsum and display the result.
Step 1:
Subtract num1 from num2 and store the result in the variable diff.
Step 2:
Take the absolute value of diff and display the result.
Step 1:
Take the absolute value of num1 and store it in the variable absNum1.
Step 2:
Take the absolute value of num2 and store it in the variable absNum2.
Step 3:
Add absNum1 and absNum2 and display the result.
Step 1:
Take the absolute value of num1 and store it in the variable absNum1.
Step 2:
Take the absolute value of num2 and store it in the variable absNum2.
Step 3:
Subtract absNum1 from absNum2 and display the result.
2.
MULTIPLE CHOICE QUESTION
30 sec β’ 1 pt
A teacher has a goal of displaying the names of 2 students selected at random from a group of 30 students in a classroom. Any possible pair of students should be equally likely to be selected. Which of the following algorithms can be used to accomplish the teacherβs goal?
Step 1:
Assign each student a unique integer from 1 to 30.
Step 2:
Generate a random integer n from 1 to 15.
Step 3:
Select the student who is currently assigned integer nand display the studentβs name.
Step 4:
Generate a new random integer n from 16 to 30.
Step 5:
Select the student who is currently assigned integer nand display the studentβs name.
Step 1:
Assign each student a unique integer from 1 to 30.
Step 2:
Generate a random integer n from 1 to 30.
Step 3:
Select the student who is currently assigned integer nand display the studentβs name.
Step 4:
Generate a new random integer n from 1 to 30.
Step 5:
Select the student who is currently assigned integer nand display the studentβs name.
Step 1:
Assign each student a unique integer from 1 to 30.
Step 2:
Generate a random odd integer n from 1 to 29.
Step 3:
Select the student who is currently assigned integer nand display the studentβs name.
Step 4:
Generate a new random even integer n from 2 to 30.
Step 5:
Select the student who is currently assigned integer nand display the studentβs name.
Step 1:
Assign each student a unique integer from 1 to 30.
Step 2:
Generate a random integer n from 1 to 30.
Step 3:
Select the student who is currently assigned integer nand display the studentβs name.
Step 4:
The student who was selected in the previous step is assigned 0. All other students are reassigned a unique integer from 1 to 29.
Step 5:
Generate a new random integer n from 1 to 29.
Step 6:
Select the student who is currently assigned integer nand display the studentβs name.
3.
MULTIPLE CHOICE QUESTION
30 sec β’ 1 pt
A certain game keeps track of the maximum and minimum scores obtained so far. If num represents the most recent score obtained, which of the following algorithms correctly updates the values of the maximum and the minimum?
If num is greater than the minimum, set the minimum equal tonum. Otherwise, if num is greater than the maximum, set the maximum equal to num.
If num is less than the minimum, set the minimum equal to num. Otherwise, if num is greater than the maximum, set the maximum equal to num.
If num is less than the minimum, set the minimum equal to num. Otherwise, if num is less than the maximum, set the maximum equal to num.
If num is greater than the minimum, set the minimum equal tonum. Otherwise, if num is less than the maximum, set the maximum equal tonum.
4.
MULTIPLE CHOICE QUESTION
30 sec β’ 1 pt
A programmer is creating an algorithm that will be used to turn on the motor to open the gate in a parking garage. The specifications for the algorithm are as follows.
-The gate should not open when the time is outside of business hours.
-The motor should not turn on unless the gate sensor is activated.
-The motor should not turn on if the gate is already open.
Which of the following algorithms can be used to open the gate under the appropriate conditions?
Check if the time is outside of business hours. If it is, check if the gate sensor is activated. If it is, check if the gate is closed. If it is, turn on the motor.
Check if the time is during business hours. If it is, check if the gate sensor is activated. If it is, check if the gate is open. If it is, turn on the motor.
Check if the time is during business hours. If it is, check if the gate sensor is activated. If it is not, check if the gate is open. If it is not, turn on the motor.
Check if the time is during business hours. If it is, check if the gate sensor is activated. If it is, check if the gate is open. If it is not, turn on the motor.
5.
MULTIPLE CHOICE QUESTION
30 sec β’ 1 pt
Which of the following statements is equivalent to the algorithm in the flowchart?
6.
MULTIPLE CHOICE QUESTION
30 sec β’ 1 pt
The variable isOpen is to be used to indicate whether or not a store is currently open. Which of the following is the most appropriate data type for isOpen ?
Boolean
number
string
list
7.
MULTIPLE SELECT QUESTION
45 sec β’ 1 pt
In a certain game, the integer variable bonus is assigned a value based on the value of the integer variable score.
-If score is greater than 100, bonus is assigned a value that is 10 times score.
-If score is between 50 and 100 inclusive, bonus is assigned the value of score.
-If score is less than 50, bonus is assigned a value of 0.
Which of the following code segments assigns bonus correctly for all possible integer values ofscore ?
Select two answers.
IF(score > 100)
{
bonus β score * 10
}
ELSE
{
IF(score β₯ 50)
{
bonus β score
}
ELSE
{
bonus β 0
}
}
IF(score β₯ 50)
{
IF(score > 100)
{
bonus β score * 10
}
ELSE
{
bonus β 0
}
}
ELSE
{
bonus β score
}
IF(score < 50)
{
bonus β 0
}
ELSE
{
IF(score β₯ 50)
{
bonus β score
}
ELSE
{
bonus β score * 10
}
}
IF(score < 50)
{
bonus β 0
}
ELSE
{
IF(score > 100)
{
bonus β score * 10
}
ELSE
{
bonus β score
}
}
Create a free account and access millions of resources
Similar Resources on Wayground
90 questions
Google Docs and Forms Quiz

Quiz
β’
3rd Grade
84 questions
3rd grade Amplify Science Review for Balancing Forces and Weather

Quiz
β’
3rd Grade
84 questions
Science Amplify Unit

Quiz
β’
3rd Grade
84 questions
Amplify Science Unit

Quiz
β’
3rd Grade
84 questions
Amplify Science Leap Review

Quiz
β’
3rd Grade
85 questions
Science 3 Q1-Q4 SY 2024-2025

Quiz
β’
3rd Grade - University
88 questions
INTERNET/ONLINE SHOPPING/GOOGLE MAPS

Quiz
β’
1st - 5th Grade
86 questions
Objective of the Discipline

Quiz
β’
2nd Grade - University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
β’
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
β’
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
β’
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
β’
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
β’
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
β’
6th - 10th Grade
19 questions
Handbook Overview

Lesson
β’
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
β’
9th Grade
Discover more resources for Computers
18 questions
Writing Launch Day 1

Lesson
β’
3rd Grade
9 questions
A Fine, Fine School Comprehension

Quiz
β’
3rd Grade
12 questions
Passport Quiz 1

Quiz
β’
1st - 5th Grade
10 questions
Place Value

Quiz
β’
3rd Grade
8 questions
Writing Complete Sentences - Waiting for the Biblioburro

Lesson
β’
3rd Grade
10 questions
Third Grade Angels Vocab Week 1

Quiz
β’
3rd Grade
12 questions
New Teacher

Quiz
β’
3rd Grade