Modify the method drawFace to take the width and height of the desired face and calculate the positions based on the desired width and height.

What will be an ideal response?

```
public void drawFace ( int upperLeftX ,
int upperLeftY ,
int width , int height )
{
// get the graphics object to use for drawing
Graphics g raphics = this . getGraphics ( ) ;
// start with a black color
graphics . se tColor ( Color . black ) ;
// draw the oval for the face
// 130 ,50 ,380 ,380
graphics . drawOval ( upperLeftX , upperLeftY ,
width , height ) ;
// draw the ovals for the eyes
int quarterDist = width / 4 ;
int tenth = height / 10 ;
graphics . fillOval ( upperLeftX + quar t e rDi s t ,
upperLeftY + quarterDist ,
tenth , tenth ) ;
graphics . fillOval ( upperLeftX + width -
quarterDist - tenth ,
upperLeftY + quarterDist ,
tenth , tenth ) ;
// draw the arcs for the eyebrows
graphics . drawArc ( upperLeftX + quarterDi s t ,
upperLeftY + quarterDist - 10 ,
tenth , tenth , 4 5 , 9 0 ) ;
graphics . drawArc ( upperLeftX + width ยก
quarterDist - tenth ,
upperLeftY + quarterDist - 10 ,
tenth , tenth , 45 , 90 ) ;
// draw the arc for the mouth
int arcWidth = ( int ) ( width * 0 . 6 7 ) ;
int arcY = ( int ) ( width * 0 . 0 9 ) ;
graphics.drawArc ( upperLeftX + ( width / 6 ) ,
upperLeftY + arcY ,
arcWidth , arcWidth ,
-45 ,-90);
}
```

Computer Science & Information Technology

You might also like to view...

A(n) ________ translates source code into an intermediate form, line by line

Fill in the blank(s) with correct word

Computer Science & Information Technology

Generating visitor traffic involves developing the right mix of offline and online promotional tools.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology