Javascript Test

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Based on the code below, what letter(s) will be created? NOTE: This IS case-sensitive. var xCoord = 100; var yCoord = 200; line (xCoord, yCoord, xCoord, yCoord + 200); line (xCoord + 225, yCoord + 50, xCoord + 225, yCoord + 200); ellipse (xCoord + 100, yCoord + 150, 100, 100); line (xCoord + 200, yCoord + 75, xCoord + 250, yCoord + 75); line (xCoord - 50, yCoord, xCoord + 50, yCoord);

Tot

Based on the code below, what letter(s) will be created? NOTE: This IS case-sensitive. line (250, 200, 300, 400); line (100, 225, 100, 400); line (100, 275, 100, 200); line (250, 200, 250, 400); line (100, 400, 125, 300); line (200, 200, 200, 400); line (300, 200, 300, 400); line (150, 200, 150, 400); line (150, 400, 125, 300);

WIN

The parameters for the ellipse command control the width, height, distance down the screen that the ellipse's center should appear, and distance across the screen that the ellipse's center should appear. For brevity's sake, we will call these width, height, down, and across. Which of these does the first ellipse parameter control? Use these terms: width, height, down, and across

across

The parameters for the rect command control the width, height, distance down the screen that the rectangle's top-left corner should appear, and distance across the screen that the rectangle's top-left corner should appear. For brevity's sake, we will call these width, height, down, and across. Which of these does the first parameter control? Use these terms: width, height, down, and across

across

What is the function used to draw an arc in JavaScript?

arc

What is the JavaScript function used to set the background color? Do not include parentheses, parameters, or semi-colons.

background

I would like to make the entire canvas black. We must do this in only one command. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

background(0,0,0);

I would like to make the entire screen a version of green which has no blue or red at all, and maximum green. HINT: The number for the maximum amount of a color is 255. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

background(0,255,0);

What color is the "marker" that draws the outline of our shapes by default?

black

What color does the third parameter represent? (color)

blue

Based on the code below, what letter(s) will be created? NOTE: This IS case-sensitive. var xCoord = 300; var yCoord = 275; line (xCoord, yCoord, xCoord, yCoord + 125); ellipse (xCoord-50, yCoord+75, 100, 100); line (xCoord, yCoord, xCoord, yCoord-75);

d

Which of the four potential values (width, height, down, and across) does the second parameter control?

down

Which of these does the second ellipse parameter control? Use these terms: width, height, down, and across

down

What is the Javascript function used to draw an oval on the screen? Do not include any symbols or numbers.

ellipse

We need to create a circle in the center of the canvas. The circle should have a diameter of 50. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

ellipse(200,200,50,50);

We need to create a circle with a center of (250, 50). It has radius of 25. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

ellipse(250,50,50,50);

We need to create an oval with a center of (50, 50). It has a height of 150 and a width of 200. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

ellipse(50,50,200,150);

What function is used to change the color of the "paint bucket" used to fill in the colors of our shapes?

fill

I would like to make the inside of all shapes I draw white. This should be a pure white, with no color at all. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

fill(255,255,255);

What color does the second parameter represent? (color)

green

Which of these (width, height, down, and across) does the fourth parameter control?

height

Which of these does the fourth ellipse parameter control? Use these terms: width, height, down, and across

height

What is the Javascript function used to draw a line segment on the screen?

line

We need to draw a line segment from (150, 100) to (25, 50). How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

line(150,100,25,50);

I'd like to draw a line segment that starts at (250,100). The segment should move directly to the left 150 pixels. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

line(250,100,100,100);

I need to draw a line from the top right corner of the canvas to the bottom left corner of the canvas. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

line(400,0,0,400);

What function is used to tell the computer not to "paint inside" of the outline of our shapes?

noFill

I'd like to make all of the shape we draw transparent after this command. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

noFill();

What function is used to get rid of the outlines around our shapes?

noStroke

I'd like to get rid of all of the outlines on shapes that we draw after this command. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

noStroke();

Based on the code below, what letter(s) will be created? NOTE: This IS case-sensitive. ellipse (250, 250, 100, 100); line (200, 225, 200, 400); line (200, 275, 200, 200);

p

What unit are we using to measure our pictures on the screen?

pixels

What is the Javascript command used to draw a rectangle on the screen? Do not include any symbols or numbers.

rect

We need to create a square for whom the middle of the square (midpoint between the x and the y) is the center of the screen. It should be 200 pixels along each side. How would we go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

rect(100,100,200,200);

We need to create a rectangle for whom the height (length on the y-axis) is 75. The top-left corner of the rectangle has an x-coordinate of 100. The width of the rectangle is 25. The top left corner of the rectangle has a y-coordinate of 50. How would we make this rectangle? Do not include any spaces in your answer, and include a semi-colon at the end.

rect(100,50,25,75);

We need to create a rectangle with a top left corner of (200, 100) that is 100 pixels wide and 70 pixels long. How would we go about doing this? Type the command with no spaces, and with a semi-colon.

rect(200,100,100,70);

What color does the first parameter represent? (color)

red

What color is the default when you tell the computer to set a color?

red

What function is used to change the color of the "marker" used to draw the outline of our shapes?

stroke

I would like to make the outline of all of the shapes I will draw red. This is a pure red - maximum red, no blue or green. How would you go about doing this? Do not include any spaces in your answer, and include a semi-colon at the end.

stroke(255,0,0);

What is the function that changes the thickness of lines and outlines?

strokeWeight

The actual information inside of a variable (if we think of a variable as a "bucket", it is what is inside of the bucket, is refered to as what? HINT: Let's say we were to establish that x=5. x is the variable. What is the name for the 5?

value

What word do you type at the beginning of the declaration of a variable?

var

A name or placeholder for something else is called a...

variable

What color is the "bucket of paint" that fills in the shapes by default?

white

Which of these (width, height, down, and across) does the third parameter control?

width

Which of these does the third ellipse parameter control? Use these terms: width, height, down, and across

width

The parameters for the line function control the x and y coordinate of the starting point in the line segment, and the x and y coordinate of the ending point in the line segment. We will call these x1, x2, y1, and y2. Which of these does the first parameter of the line function control? Use these terms: x1, x2, y1, and y2

x1

Which of these does the third parameter of the line function control? Use these terms: x1, x2, y1, and y2

x2

Which of these does the second parameter of the line function control? Use these terms: x1, x2, y1, and y2

y1

Which of these does the fourth parameter of the line function control? Use these terms: x1, x2, y1, and y2

y2

What symbol do we put around our parameters? Type both of the symbols, in order.

()

What symbol do we place in between each of the parameters? Type the symbol; do not write out the name.

,

How many parameters does noStroke require?

0

What number do we use with the parameter to represent that there will be "none" of the component color in our final color? Answer all numeric questions with number and not with words.

0

What number would go along with the x-coordinate of the left hand side of the screen?

0

What number would go along with the y-coordinate on the top of the screen?

0

What number do we use with the parameter to represent that there will be "a maximum amount" of the component color in our final color? Answer all numeric questions with number and not with words.

255

How many parameters does this function require?

3

The official name for the information placed in the parentheses that you use to tell the commands information they need is "parameters". How many parameters are needed in order to tell JavaScript how to create a rectangle? Please answer this and any other numeric problems with a number, not with a word (i.e. 100 instead of "one hundred").

4

What number would go along with the x-coordinate of the right-hand side of the screen?

400

What number would go along with the y-coordinate of the bottom of the screen?

400

What symbol is used at the end of a command in order to signify that the command is complete?

;

What symbol is used to assign a value to a variable? Please type the sign itself; do not write out the name of the sign.

=

What do we call documents that explain how to program in a particular language and environment?

Documentation

T/F: You are allowed to have spaces inside of our variable names?

False

Based on the code below, what letter(s) will be created? NOTE: This IS case-sensitive. line (100, 200, 200, 300); line (300, 300, 300, 400); line (300, 200, 200, 300); line (300, 300, 300, 200); line (100, 400, 100, 200);

M


Set pelajaran terkait

Chapter 31 -- Addiction & Substance related disorders Prep-U Questions

View Set

AZ-500: Manage security operation

View Set

Chapter 5 The Counseling Process

View Set

EMT- Chapter 11- Airway Management

View Set

American Government Exercise quizzes

View Set

RHIT EXAM: PART 10 - INFORMATICS AND INFORMATION SYSTEMS

View Set

Reproductive and genitourinary system, Pharm made easy

View Set