Unit 4 #5

Quiz
•
Chemistry
•
12th Grade
•
Easy
Clifford Buckles
Used 6+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following procedures, which are used to control a device that draws lines on paper.
Consider the goal of using the device to produce the following drawing, where each line shown has a length of 10 units and the horizontal lines are 10 units apart.
The device is positioned at the upper-left corner of a sheet of paper and is facing right. Which of the following code segments will produce the drawing shown?
penDown()
goForward(10)
turnRight(90)
goForward(10)
turnRight(90)
goForward(10)
penDown()
goForward(10)
penUp()
turnRight(90)
turnRight(90)
penDown()
goForward(10)
penDown()
goForward(10)
turnRight(90)
penUp()
goForward(10)
turnRight(90)
penDown()
penDown()
goForward(10)
penUp()
turnRight(90)
goForward(10)
turnRight(90)
penDown()
goForward(10)
2.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of the following are ways in which a programmer can use abstraction to manage the complexity of a program?
Select two answers.
response - correct
Responses
Replacing each instance of repeated code with a call to a procedure
Replacing longer variable names with shorter variable names to reduce typing errors
Replacing several lines of documentation with a single line of documentation
Replacing several lines of documentation with a single line of documentation name1, name2, name3, and name4 with a list of strings
called names
3.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of the following are benefits of procedural abstraction?
Select two answers.
Procedural abstraction prevents programmers from accidentally using the intellectual property of other programmers.
Procedural abstraction eliminates the need for programmers to document their code.
Procedural abstraction makes it easier for people to read computer programs.
Procedural abstraction provides an opportunity to give a name to a block of code that describes the purpose of the code block.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following procedure.
PROCEDURE doSomething(num1, num2)
{
DISPLAY(num1)
RETURN(num1)
DISPLAY(num2)
}
Consider the following statement.
DISPLAY(doSomething(10, 20))
What is displayed as a result of executing the statement above?
Responses
10 10
10 20
10 10 20
10 20 10
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following procedure.
Procedure CallExplanationdrawLine(x1, y1, x2, y2)Draws a line segment on a coordinate grid with endpoints at coordinates (x1, y1) and (x2, y2)
The drawLine procedure is to be used to draw the following figure on a coordinate grid.
Which of the following code segments can be used to draw the figure?
Responses
xVal ← 1
yVal ← 0
len ← 1
REPEAT 5 TIMES
{
drawLine(xVal, yVal, xVal, yVal + len)
xVal ← xVal + 1
len ← len + 1
}
xVal ← 1
yVal ← 0
len ← 1
REPEAT 5 TIMES
{
drawLine(xVal, yVal, xVal + len, yVal)
yVal ← yVal + 1
len ← len + 1
}
xVal ← 5
yVal ← 0
len ← 5
REPEAT 5 TIMES
{
drawLine(xVal, yVal, xVal, yVal + len)
xVal ← xVal - 1
}
xVal ← 5
yVal ← 0
len ← 5
REPEAT 5 TIMES
{
drawLine(xVal, yVal, xVal + len, yVal)
yVal ← yVal - 1
len ← len - 1
}
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The following question uses a robot in a grid of squares. The robot is represented by a triangle, which is initially facing right.
Consider the following procedure.
Which of the following code segments will move the robot to the gray square along the path indicated by the arrows?
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A student is developing a program that allows users to look up the definitions of words that appear in a book.
The student plans to perform a large number of searches through a dictionary containing words and their definitions. The student will use a procedure written by a computer scientist to quickly search the dictionary (and knows that the procedure will return a definition if one is available). The student cannot modify the search procedure written by the computer scientist but can call the procedure by supplying a word.
Which of the following is a true statement about the student’s use of the computer scientist’s search procedure?
The student is changing the search procedure’s internal abstractions.
The student is modifying the search procedure to take a definition as an argument and return the corresponding word.
The student is reusing the computer scientist’s procedural abstraction by knowing what the procedure does without knowing how it does it.
The student is reusing the computer scientist’s procedural abstraction by using duplicate code each time a search needs to occur.
Create a free account and access millions of resources
Similar Resources on Wayground
15 questions
Bohr atomic model game

Quiz
•
8th - 12th Grade
11 questions
Chemical Kinetics

Quiz
•
12th Grade
10 questions
5.2 Quantum Theory and the Atom

Quiz
•
9th - 12th Grade
15 questions
Level 2 Class Quiz - Heart

Quiz
•
11th - 12th Grade
15 questions
Acid-Base Titrations

Quiz
•
11th - 12th Grade
15 questions
Atomic Theory Quiz

Quiz
•
10th - 12th Grade
15 questions
Thermochemistry

Quiz
•
9th Grade - University
15 questions
I - Laboratory procedure

Quiz
•
11th - 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
Discover more resources for Chemistry
20 questions
Atomic Structure

Quiz
•
10th - 12th Grade
15 questions
Exploring the Unique Properties of Water

Interactive video
•
9th - 12th Grade
17 questions
CHemistry Unit 7 Dimensional Analysis Practice

Quiz
•
9th - 12th Grade
47 questions
Unit #4 Electron KAP Test Review

Quiz
•
10th - 12th Grade
7 questions
Elements, Compounds, Mixtures

Lesson
•
9th - 12th Grade
12 questions
Significant figures

Quiz
•
9th - 12th Grade
20 questions
States of Matter and Phase Changes

Quiz
•
9th - 12th Grade
20 questions
Chapter 1 - Chemistry, Matter, and Measurements (24- Present)

Quiz
•
9th - 12th Grade