APCSP

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

What symbol do you use to do multiplication in JavaScript?

*

In the following code, we create a circle and add it to the screen. What is the meaning of the x variable? var x = 20; var circle = new Circle(x); add(circle);

The radius of the circle

What is a callback function?

A function passed to an event handler that is called every time a certain event happens

What symbol do you use to do division in JavaScript?

/

println(2 + 2);

4

To ask the user of the program for a number, which function should you use?

Both readInt and readFloat are for numbers.

We've written a function animate that moves a ball across the screen like this: function start(){ //add code here } function animate(e){ ball.move(5, 5); } How can we set up animate to be called every time a key on the keyboard is pressed down?

function start(){ keyDownMethod(animate); }

What function do you need to call to get the width of the screen?

getWidth()

What are the coordinates of the top right corner of the screen?

getWidth(), 0

Suppose we've written a function drawCircle that we want to call every time the mouse is clicked. How can we do this?

mouseClickMethod(drawCircle);

to print a line

println();

What function do you need to call to ask the user of the program to enter text?

readLine

Varaible

var


Set pelajaran terkait

AC 509 Chapter 2 The Role of Financial Markets and Financial Intermediaries

View Set

HIV (Human Immunodeficiency Virus)

View Set

Introduction to physical agents (Ch.1)

View Set

Economics // Chapter 7 Content // Economic Growth

View Set

Week 11: Pre-reading Material (week 10 = no class)

View Set