
Unit 4 #2
Authored by Clifford Buckles
Chemistry
12th Grade
NGSS covered
Used 7+ 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 two lists of numbers called list1 and list2. A programmer wants to determine how many different values appear in both lists. For example, if list1 contains [10, 10, 20, 30, 40, 50, 60] and list2 contains [20, 20, 40, 60, 80], then there are three different values that appear in both lists (20, 40, and 60).
The programmer has the following procedures available.
Which of the following can be used to assign the intended value to count ?
bothList ← Combine (list1, list2)
uniqueList ← RemoveAllDups (bothList)
count ← LENGTH (bothList) - LENGTH (uniqueList)
newList1 ← RemoveAllDups (list1)
newList2 ← RemoveAllDups (list2)
bothList ← Combine (newList1, newList2)
count ← LENGTH (list1) + LENGTH (list2) - LENGTH (bothList)
newList1 ← RemoveAllDups (list1)
newList2 ← RemoveAllDups (list2)
bothList ← Combine (newList1, newList2)
count ← LENGTH (newList1) + LENGTH (newList2) - LENGTH (bothList)
newList1 ← RemoveAllDups (list1)
newList2 ← RemoveAllDups (list2)
bothList ← Combine (newList1, newList2)
uniqueList ← RemoveAllDups (bothList)
count ← LENGTH (bothList) - LENGTH (uniqueList)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A computer program contains code in several places that asks a user to enter an integer within a specified range of values. The code repeats the input request if the value that the user enters is not within the specified range. A programmer would like to create a procedure that will generalize this functionality and can be used throughout the program. The correct use of the procedure is shown below, where min is the least acceptable value, max is the greatest acceptable value, and promptString is the string that should be printed to prompt the user enter a value.
inputVal ← getRange(min, max, promptString)
Which of the following is a correct implementation of the getRange procedure?
PROCEDURE getRange(min, max, promptString)
{
DISPLAY(promptString)
RETURN(INPUT())
}
PROCEDURE getRange(min, max, promptString)
{
DISPLAY(promptString)
x ← INPUT()
RETURN(x)
}
PROCEDURE getRange(min, max, promptString)
{
DISPLAY(promptString)
x ← INPUT()
REPEAT UNTIL(x ≥ min AND x ≤ max)
{
DISPLAY(promptString)
x ← INPUT()
}
}
PROCEDURE getRange(min, max, promptString)
{
DISPLAY(promptString)
x ← INPUT()
REPEAT UNTIL(x ≥ min AND x ≤ max)
{
DISPLAY(promptString)
x ← INPUT()
}
RETURN(x)
}
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
A program is created to perform arithmetic operations on positive and negative integers. The program contains the following incorrect procedure, which is intended to return the product of the integers and .
A programmer suspects that an error in the program is caused by this procedure. Under which of the following conditions will the procedure NOT return the correct product?
Select two answers.
When the values of x and y are both positive.
When the values of x is positive and the value of y is negative.
When the values of x is negative and the value of y is positive.
When the values of x and y are both negative.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following procedure is intended to return the number of times the value val appears in the list myList. The procedure does not work as intended.
Line 01: PROCEDURE countNumOccurences(myList, val)
Line 02: {
Line 03: FOR EACH item IN myList
Line 04: {
Line 05: count ← 0
Line 06: IF(item = val)
Line 07: {
Line 08: count ← count + 1
Line 09: }
Line 10: }
Line 11: RETURN(count)
Line 12: }
Which of the following changes can be made so that the procedure will work as intended?
Changing line 6 to IF(item = count)
Changing line 6 to IF(myList[item] = val)
Moving the statement in line 5 so that it appears between lines 2 and 3
Moving the statement in line 11 so that it appears between lines 9 and 10
Tags
NGSS.K-2-ETS1-1
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A student is creating a procedure to determine whether the weather for a particular month was considered very hot. The procedure takes as input a list containing daily high temperatures for a particular month. The procedure is intended to return true if the daily high temperature was at least 90 degrees for a majority of days in the month and return false otherwise.
Which of the following can be used to replace <Missing Code> so that the procedure works as intended?
Tags
NGSS.3-ESS2-1
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following procedure is intended to return true if at least two of the three parameters are equal in value and is intended to return false otherwise.
PROCEDURE AnyPairs (x, y, z)
{
IF (x = y)
{
RETURN (true)
}
ELSE
{
RETURN (y = z)
}
}
For which of the following procedure calls does the procedure NOT return the intended value?
AnyPairs ("bat", "cat", "rat")
AnyPairs ("bat", "bat", "rat")
AnyPairs ("bat", "cat", "bat")
AnyPairs ("bat", "cat", "cat")
7.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
The procedure NumOccurrences is intended to count and return the number of times targetWord appears in the list wordList. The procedure does not work as intended.
For which of the following code segments will the call to NumOccurrences NOT return the intended value?
Select two answers.
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
15 questions
Nitrogen and Sulphur
Quiz
•
11th - 12th Grade
10 questions
Periodic Table
Quiz
•
12th Grade
10 questions
Dimensional Analysis
Quiz
•
9th - 12th Grade
11 questions
OXIDES OF CARBON
Quiz
•
10th - 12th Grade
15 questions
Know Quiz 1 physical science
Quiz
•
9th - 12th Grade
15 questions
Acids, alkalis and neutralisation
Quiz
•
12th Grade
13 questions
2.1 and 2.2 quiz
Quiz
•
7th - 12th Grade
15 questions
Solid States
Quiz
•
12th 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
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th 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
Discover more resources for Chemistry
20 questions
Types of Chemical Reactions
Quiz
•
9th - 12th Grade
20 questions
electron configurations and orbital notation
Quiz
•
9th - 12th Grade
14 questions
Reaction Types, Balancing, and Predicting Products
Quiz
•
9th - 12th Grade
8 questions
Empirical and Molecular Formulas
Lesson
•
9th - 12th Grade
4 questions
Stoichiometry Lesson
Lesson
•
9th - 12th Grade