Knowee
Questions
Features
Study Tools

Given the following code:public void paintComponent(Graphics g) {   super.paintComponent(g);   Graphics2D g2 = (Graphics2D)g;   g2.translate( getWidth()/2, getHeight()/2 );   g2.rotate( 30 * Math.PI / 180 );   g2.fillRect(0,0,200,200);}Which of the following describes the output?Question 1Select one or more:a.A filled black square that is 100-by-100 pixels in size.b.The corner of the square is at the center of the component that is being painted, and the top side of the square descends at a 30 degree angle from that point.c.The rotate command rotates the picture by 30 degrees in a clockwise direction about the origin.d.The top of the square is rotated from the horizontal position onto a line that is 30 degrees clockwise of the horizontal. That line descends at a 30 degree angle.

Question

Given the following code:public void paintComponent(Graphics g) {   super.paintComponent(g);   Graphics2D g2 = (Graphics2D)g;   g2.translate( getWidth()/2, getHeight()/2 );   g2.rotate( 30 * Math.PI / 180 );   g2.fillRect(0,0,200,200);}Which of the following describes the output?Question 1Select one or more:a.A filled black square that is 100-by-100 pixels in size.b.The corner of the square is at the center of the component that is being painted, and the top side of the square descends at a 30 degree angle from that point.c.The rotate command rotates the picture by 30 degrees in a clockwise direction about the origin.d.The top of the square is rotated from the horizontal position onto a line that is 30 degrees clockwise of the horizontal. That line descends at a 30 degree angle.

...expand
🧐 Not the exact question you are looking for?Go ask a question

Solution

The output of the given code is:

c. The rotate command rotates the picture by 30 degrees in a clockwise direction about the origin.

Similar Questions

b.void draw() {    background(200, 240, 200);    fill(150, 200, 150);    rect(mapCoord(x), mapCoord(y), stretch(x, sideLength), stretch(y, sideLength));    fill(0);    rect(x, y, sideLength, sideLength);}

What is the output of the given code?abstract class Shape{    int i = 111, j = 222;    abstract void calcArea();    abstract void calcVolume();} abstract class Quadrilateral extends Shape{    void calcArea()    {        System.out.println(i);     }}class Square extends Quadrilateral{    void calcVolume()    {        System.out.println(j);     }}public class Test{    public static void main(String[] args)    {        Square c = new Square();         c.calcArea();         c.calcVolume();              }}Select one:a.Compile time error because 'class Square' is not override all the abstract methods, so should declare it as 'abstract'b.Compile time error because trying to instantiate the 'class Square' which does not override all the abstract methodsc.Run time Errord.111222

What is the output of the given code?abstract class Shape{    int i = 111, j = 222;    abstract void calcArea();    abstract void calcVolume();} abstract class Quadrilateral extends Shape{    void calcArea()    {        System.out.println(i);     }}class Square extends Quadrilateral{    void calcVolume()    {        System.out.println(j);     }}public class Test{    public static void main(String[] args)    {        Square c = new Square();         c.calcArea();         c.calcVolume();              }}Select one:a.111222b.Compile time error because 'class Square' is not override all the abstract methods, so should declare it as 'abstract'c.Compile time error because trying to instantiate the 'class Square' which does not override all the abstract methodsd.Run time Error

Which of the following is defined as the drawing of number of copies of the same image in rows and columns across the interface window so that they cover the entire window? A. Zooming B. Roaming C. Panning D. Tiling

Which transformations involve changing the size of an object in computer graphics?Question 26Select one or more:a.Reflectionb.Scalingc.Translationd.Shearinge.Rotation

1/1

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.