228k views
2 votes
Assume you have an 800 by 600 applet window and that g is an object of the Graphics class. Which of the following commands will display a message near the bottom of the screen?

a. g.drawString(200,50,"APCS is awesome!");
b. g.drawString(200,550,"APCS is awesome!");
c. g.drawString("APCS is awesome!",200,550);
d. g.drawString("APCS is awesome!",200,750);

User Saravana
by
8.0k points

1 Answer

2 votes

Final answer:

The command c. g.drawString("APCS is awesome!",200,550) will display the message near the bottom of an 800 by 600 applet window, as it places the text within the visible area near the lower edge.

Step-by-step explanation:

The correct command to display a message near the bottom of an 800 by 600 applet window using the Graphics class object g is c. g.drawString("APCS is awesome!",200,550). This is because the drawString method uses coordinates where the first value is the x-coordinate (how far right the text starts) and the second value is the y-coordinate (how far down the text is placed). An applet window of 800 by 600 pixels has its bottom edge near the y-coordinate of 600. Option c places the text 550 pixels down, which is near the bottom but still within the visible area of the applet window.

User Byaruhaf
by
8.6k points