Unit 4 #5

Unit 4 #5

12th Grade

10 Qs

quiz-placeholder

Similar activities

Module 7 - Hydrocarbons

Module 7 - Hydrocarbons

12th Grade

15 Qs

Modelos atômicos e massa/balanceamento/leis ponderais

Modelos atômicos e massa/balanceamento/leis ponderais

10th - 12th Grade

11 Qs

Kiến thức về kim loại nhóm IIA

Kiến thức về kim loại nhóm IIA

12th Grade

15 Qs

Thermochemistry kuiz 2

Thermochemistry kuiz 2

12th Grade - Professional Development

10 Qs

Nitrogen and ammonia

Nitrogen and ammonia

11th Grade - University

12 Qs

NEUTRALISATION

NEUTRALISATION

11th - 12th Grade

11 Qs

significant figures in problems quiz

significant figures in problems quiz

10th - 12th Grade

13 Qs

NOMENCLATURE ACID BASE REVIEW 1

NOMENCLATURE ACID BASE REVIEW 1

10th - 12th Grade

11 Qs

Unit 4 #5

Unit 4 #5

Assessment

Quiz

Chemistry

12th Grade

Practice Problem

Easy

Created by

Clifford Buckles

Used 6+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

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

Media Image

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

Media Image

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?

Media Image
Media Image
Media Image
Media Image

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.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?