Answer:

gr.drawString("Loveliest of trees, the cherry now", 25, 30);
gr.drawString("Is hung with bloom along the bough", 25, 50 );

You want to start the second line at the same distance from the left edge as the first line, 25. If characters are 10 pixels high, you need to increase y from 30 to something greater than 40 (since there should be some space between lines.)

Slightly New Example

Say that the drawing area is 300 pixels wide and 150 pixels high. Here is a partly completed applet that writes the word "Hello" roughly in the center of this area.

// Put "Hello" at the center of a 300 by 150 drawing area
//
import javax.swing.JApplet;
import java.awt.*;

public class AnotherHello extends JApplet 
{
  public void paint ( Graphics gr )
  { 
    setBackground( Color.lightGray );
    gr.drawString("Hello", , 75 );
   }
}

The background color of the drawing area is set to light gray.

QUESTION 5:

Calculate the X value to fill the blank so that the lower left corner of the 'H' in "Hello" is in the center of the drawing area.