If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Using variables

Problem

In the following code, we define a variable and draw three shapes - a rectangle and two ellipses:
var xPos = 55;
rect(10, 20, 30, 40);
ellipse(xPos, 20, 15, 30);
ellipse(xPos, 10, 20, 30);
At what x position are the ellipses drawn?
  • Your answer should be
  • an integer, like 6
  • an exact decimal, like 0, point, 75
  • a simplified proper fraction, like 3, slash, 5
  • a simplified improper fraction, like 7, slash, 4
  • a mixed number, like 1, space, 3, slash, 4
Stuck?
Stuck?