Unit 4 #4

Quiz
•
Chemistry
•
12th Grade
•
Easy
Clifford Buckles
Used 5+ times
FREE Resource
10 questions
Show all answers
1.
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.
Let the value of the variable xVal be 6 and the value of the variable yVal be 5. Which of the following code segments can be used to draw the figure?
drawLine(1, 5, xVal, yVal)
drawline(1, 5, xVal, yVal + 2)
drawline(1, 5, xVal, yVal + 2)
drawLine(1, 5, xVal, yVal)
drawline(1, 5, xVal, yVal + 2)
drawline(1, 5, xVal, yVal - 2)
drawLine(1, 5, xVal, yVal)
drawline(1, 5, xVal + 2, yVal + 2)
drawline(1, 5, xVal + 2, yVal - 2)
drawLine(1, 5, xVal, yVal)
drawline(1, 5, xVal + 2, yVal + 2)
drawline(1, 5, xVal - 2, yVal - 2)
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The procedure Draw (length, direction) is used to draw a line segment length units long in a given direction (left, right, up, or down), starting at the current cursor position. The cursor is then repositioned at the end of the line segment that was drawn. Consider the following program, where the cursor starts in the upper left corner of a grid of dots. The dots are spaced one unit apart.
Draw (1, right)
Draw (2, down)
Draw (1, left)
Draw (1, right)
Draw (1, up)
Draw (1, left)
Which of the following represents the figure that is drawn by the program?
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A photographer has a collection of digital pictures, each using the same file-naming format: a date tag, followed by a description, followed by the file extension ".jpg". The photographer wants to write a code segment to extract the description from each file name, as shown in the following table.
Original File NameExtracted Description2016-05-22-Andrews-Graduation.jpgAndrews-Graduation2016-07-04-Fireworks.jpgFireworks2017-10-18-Grandmas-Birthday.jpgGrandmas-Birthday
The photographer has the following procedures available.
Procedure CallExplanationTrimLeft (str, n)Returns a copy of the string str with the n leftmost characters removed. For example, TrimLeft ("keyboard", 3) returns "board".TrimRight (str, n)Returns a copy of the string str with the n rightmost characters removed. For example, TrimRight ("keyboard", 3) returns "keybo".
Let an original file name be stored in the string variable original. Which of the following statements will correctly extract the description and store it in the string variable descr ?
-descr ← TrimLeft (TrimRight (original, 4), 11)
-descr ← TrimLeft (TrimRight (original, 11), 4)
-descr ← TrimRight (TrimLeft (original, 11), 4)
I only
II only
I and III
II and III
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A student’s overall course grade in a certain class is based on the student’s scores on individual assignments. The course grade is calculated by dropping the student’s lowest individual assignment score and averaging the remaining scores.
For example, if a particular student has individual assignment scores of 85, 75, 90, and 95, the lowest score (75) is dropped. The calculated course grade is (85+90+95)/3=90.
A programmer is writing a program to calculate a student’s course grade using the process described. The programmer has the following procedures available.
Procedure CallExplanationMin (numList)Returns the minimum value in the list numListSum (numList)Returns the sum of the values in the list numList
The student’s individual assignment scores are stored in the list scores. Which of the following can be used to calculate a student’s course grade and store the result in the variable finalGrade?
finalGrade ← Sum (scores) / LENGTH (scores)
finalGrade ← finalGrade - Min (scores)
finalGrade ← Sum (scores) / (LENGTH (scores) - 1)
finalGrade ← finalGrade - Min (scores)
finalGrade ← Sum (scores) - Min (scores)
finalGrade ← finalGrade / LENGTH (scores)
finalGrade ← Sum (scores) - Min (scores)
finalGrade ← finalGrade / (LENGTH (scores) - 1)
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
The figure below shows a robot in a grid of squares. The robot is represented as a triangle, which is initially facing upward. The robot can move into a white or gray square but cannot move into a black region.
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 toward the top of the grid.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following procedure.
Procedure CallExplanationdrawCircle(xPos, yPos, rad)Draws a circle on a coordinate grid with center (xPos, yPos) and radius rad
The drawCircle procedure is to be used to draw the following figure on a coordinate grid.
Let the value of the variable x be 2, the value of the variable y be 2, and the value of the variable r be 1. Which of the following code segments can be used to draw the figure?
drawCircle(x, y, r)
drawCircle(x, y + 2, r)
drawCircle(x + 2, y, r)
drawCircle(x + 2, y + 2, r)
drawCircle(x, y, r)
drawCircle(x, y + 3, r)
drawCircle(x + 3, y, r)
drawCircle(x + 3, y + 3, r)
drawCircle(x, y, r + 2)
drawCircle(x, y + 2, r + 2)
drawCircle(x + 2, y, r + 2)
drawCircle(x + 2, y + 2, r + 2)
drawCircle(x, y, r + 3)
drawCircle(x, y + 3, r + 3)
drawCircle(x + 3, y, r + 3)
drawCircle(x + 3, y + 3, r + 3)
Create a free account and access millions of resources
Similar Resources on Wayground
13 questions
Rates of Reaction

Quiz
•
9th - 12th Grade
14 questions
Art of Science Vocabulary

Quiz
•
9th - 12th Grade
15 questions
Electrolysis

Quiz
•
11th - 12th Grade
10 questions
Unit 4 #5

Quiz
•
12th Grade
10 questions
Unit 4 #3

Quiz
•
12th Grade
15 questions
ĐỀ 16

Quiz
•
9th - 12th Grade
10 questions
5.2.1 Hess' Law

Quiz
•
12th Grade
12 questions
Bohr Models & Dot Diagrams

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
50 questions
Trivia 7/25

Quiz
•
12th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
11 questions
Negative Exponents

Quiz
•
7th - 8th Grade
12 questions
Exponent Expressions

Quiz
•
6th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade
18 questions
"A Quilt of a Country"

Quiz
•
9th Grade