Computer Midterm Test Quizlet23

Ace your homework & exams now with Quizwiz!

D. 6

Consider the following program. What is the value of score at the end of this program?

When the left mouse button is pressed, the sprite rotates. When the right arrow key is pressed, it moves to the right.

Describe what will happen in the following program.

C.

Given the functions below, write a program that will draw the scene on the right.

DrawRect; should be drawRect();

The program below attempts to draw a blue rectangle but does not work as intended. What change needs to be made for the blue rectangle to be drawn?

Move drawSprites(); to the end of the program.

The program below attempts to draw a crab with a blue background. What change needs to be made so that it works correctly?

Update the first argument of rect() to 100.

The program below draws the scene on the right, but you want the rectangle to be further to the right. How can you change the code to achieve this?

In programming, an expression that evaluates to true or false.

What is a Boolean Expression?

Part of a program that does not work correctly.

What is a bug?

A statement that only runs when certain conditions are true.

What is a conditional?

A label for a piece of information used in a program.

What is a variable?

A. and B.

Which of the following programs correctly draws a rectangle at a random x position? (Select two).

B.

Which program will draw the image below?

C. orangeFish.x = orangeFish.x - 2;

You need to update the code below to animate the fish to move from the right side of the screen to the left side of the screen. In the draw loop, what line of code do you need to add before drawSprites()?

Volume

You want to create a variable to store how loud the music is playing on your cell phone. What would be the best variable name?

rock.velocityY = rock.velocityY + 0.2;

Your friend has added code to simulate gravity. What new line of code are you most likely to see in their program?


Related study sets

Billy Joel - We Didn't Start the Fire

View Set

Algebra 2 semester 1 final study guide

View Set

Module quiz: Create, Read, Update and Delete (CRUD) Operations

View Set

Ch. 9 - Commercial Package Policy & Commercial Property Coverage

View Set