wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Java Pictures Quizizz 1

Total questions: 20

Worksheet time: 51mins

Name
Class
Date
1.

Figure f=new Figure(50,200);

f.draw(100,100);

Where does f draw from the starting point?

a)

right 100, up 100

b)

right 100, down 100

c)

left 100, up 100

d)

left 100, down 100

2.

Picture p=-new Picture("TEST", 600,700);

Figure f=new Figure(20,20);

What is the code to make figures display on your picture?

a)

p.plus(f);

b)

p.show(f);

c)

p.display(f);

d)

p.add(f);

3.

f.draw(-100,0);


What kind of line is drawn?

a)

horizontal

b)

veritcal

c)

slope of 1

d)

slope of -1

4.

f.draw(-100,-100);


What kind of line is drawn?

a)

horizontal

b)

vertical

c)

slope of 1

d)

slope of -1

5.

f.draw(100,0);

f.draw(0,100);

f.close();


what shape is made?

a)

line

b)

triangle

c)

rectangle

d)

polygon

6.

f.draw(200,200);

f.setFilled(true);


what is displayed when you add f to your picture?

a)

line

b)

triangle

c)

nothing

7.

f.drawArc(100,200,0,360);


What is the shape of f?

a)

circle

b)

horizontal oval

c)

veritcal oval

d)

half circle

8.

f.drawArc(100,100,90,270);


Which hemisphere is displayed?

a)

northern hemisphere

b)

southern hemisphere

c)

eastern hemisphere

d)

western hemisphere

e)

nothing is displayed

9.

f.drawArc(100,-100,0,180);


Which hemisphere is displayed?

a)

northern hemisphere

b)

southern hemisphere

c)

eastern hemisphere

d)

western hemisphere

e)

nothing is displayed

10.

f.drawArc(100,100,270,90);


Which hemisphere is displayed?

a)

northern hemisphere

b)

southern hemisphere

c)

eastern hemisphere

d)

western hemisphere

e)

nothing is displayed

11.

f.drawArc(-100,100,0,180);


Which hemisphere is displayed?

a)

northern hemisphere

b)

southern hemisphere

c)

eastern hemisphere

d)

western hemisphere

e)

nothing is displayed

12.

Picture p=new Picture();

Figure f=new Figure(100,100);

f.draw(100,100);

f.setColor(Figure.RED);

Figure g=new Figure(100,100);

g.draw(100,100);

g.setColor(Figure.BLUE);

g.setLineWidth(10);

p.add(f);

p.add(g);


What do you see in the picture?

a)

a red line

b)

a blue line

c)

both red and blue lines

d)

nothing

13.

Picture p=new Picture();

Figure f=new Figure(100,100);

f.draw(100,100);

f.draw(100,0);

f.setFilled(true);

f.setColor(Figure.RED);

Figure g=new Figure(100,100);

g.draw(100,100);

g.draw(100,0);

g.close();

g.setLineWidth(25);

g.setColor(Figure.BLUE);


p.add(g);

p.add(f);


What do you see in the picture?

a)

a blue triangle only

b)

a red triangle only

c)

a blue triangle with a red outline

d)

a red triangle with a blue outline

e)

nothing

14.

Color x=new Color(0,255,0);


What color is x?

a)

red

b)

green

c)

blue

d)

black

e)

white

15.

Figure f = new Figure(50,50);

f.setColor(Figure.BLUE);

f.draw(100,0);

f.draw(0,100);

f.draw(-100,0);

f.setLineWidth(3);

f.setColor(Figure.RED);

f.setFilled(true);


What does figure f make?

a)

blue triangle

b)

red triangle

c)

blue square

d)

red square

e)

nothing

16.

Figure f1 = new Figure(320,175);

f1.draw(40,0);

f1.draw(0,40);

f1.draw(-40,0);

f1.close();

f1.draw(0,100);

f1.setLineWidth(10);


Figure f = new Figure(290, 175);

f.draw(-40,0);

f.draw(0,100);

f.draw(40,0);

f.close();

f.setLineWidth(10);


Figure f2 = new Figure(220,175);

f2.draw(-20,0);

f2.draw(0,103);

f2.draw(0,-103);

f2.draw(-20,0);

f2.setLineWidth(10);


Figure f3 = new Figure(150,175);

f3.draw(-40,0);

f3.draw(0,48);

f3.draw(40,0);

f3.draw(0,52);

f3.draw(-40,0);

f3.setLineWidth(10);


What word is spelled out when the figures are added to the picture?

a)

stop

b)

tops

c)

post

d)

pots

17.

Figure f1 = new Figure(100,175);

f1.draw(40,0);

f1.draw(0,40);

f1.draw(-40,0);

f1.close();

f1.draw(0,100);

f1.setLineWidth(10);


Figure f = new Figure(220, 175);

f.draw(-40,0);

f.draw(0,100);

f.draw(40,0);

f.close();

f.setLineWidth(10);


Figure f2 = new Figure(290,175);

f2.draw(-20,0);

f2.draw(0,103);

f2.draw(0,-103);

f2.draw(-20,0);

f2.setLineWidth(10);


Figure f3 = new Figure(360,175);

f3.draw(-40,0);

f3.draw(0,48);

f3.draw(40,0);

f3.draw(0,52);

f3.draw(-40,0);

f3.setLineWidth(10);


What word is spelled out when the figures are added to the picture?

a)

stop

b)

tops

c)

post

d)

pots

18.

class aCompleteProgram{


public static void main(String [] args){

Picture p = new Picture();


Figure f0 = new Figure(150,50);

f0.draw(150,0);

f0.draw(100,125);

f0.draw(0,100);

f0.draw(-100,115);

f0.draw(-150,0);

f0.draw(-100,-115);

f0.draw(0,-100);

f0.close();

f0.setColor(Figure.RED);

f0.setFilled(true);

}

}


What is displayed on the screen when the program is run?

a)

triangle

b)

rectangle

c)

hexagon

d)

octagon

e)

nothing

19.

How many files must you copy, paste, and compile in order for our java pictures to work properly?

a)

1

b)

2

c)

3

d)

4

20.

class interestingTestQuestion{


public static void main(String [] args){

Picture p = new Picture();

int y=1;

int r=50;

for(int x=0;x<1000;x++)

{

if(x<499)

y++;

else

y--;

if(y==0)

{

x=0;

r=(int)(Math.random()*400);

}

Figure f = new Figure(y,r);

f.drawArc(5,5,0,360);

f.setFilled(true);

p.add(f);

p.pause(2);

p.remove(f);

}

}

}


Describe what is happening in this program?

a)

A ball creating a horizontal line across the screen

b)

A ball jumping all over the screen

c)

A ball bouncing back and forth across the screen horizontally

d)

A ball bouncing back and forth across the screen vertically

e)

A ball moving across the screen twice