Is anyone here good at computer science?

<p>If so, can you help me out on this particular homework problem? I’m kind of frazzled:</p>

<p>In the listing below, the class TextPrinter prints a string at the specified location. Modify the TextPrinter class so that the location at which text is drawn is stored as a pair of private member variables (x and y), and is NOT passed into the drawText()function. Remember to write any methods necessary to allow the client to manipulate the current location.</p>

<p>class TextPrinter
{
public void drawText (String text, int x, int y)
{
g.drawString (text, x, y,);
}
}</p>

<p>class TextPrinter
{</p>

<p>private int x=0;
private int y=0;</p>

<p>public void drawText (String text)
{
g.drawString (text,x,y)
}</p>

<p>public void changeX(int a)
{
x = a;
}</p>

<p>public void changeY(int a)
{
y = a;
}</p>

<p>}</p>

<p>this changes x and y from variables that are input to variables that are members of the class TextPrinter only.
so the method drawText no longer needs the parameters int x and int y - drawString can just call them from the class</p>