// Created by David Bierbaum 9/19/2000
// This program will print my name on the screen and display an archery // target consisting of at least 3 concentric colored rings, complete
// with scoring values. Methods must be used to simplify the program.

import java.awt.*;
import java.applet.Applet;
public class Archery extends Applet
{
int score = 10;
public void paint (Graphics surface)
{

//print name, title and date on screen
surface.drawString("Archery Target Using Methods",140,10);
surface.drawString("David Bierbaum",170,25);
surface.drawString("9/19/2000",175,40);
drawTarget(surface,205,180,220);
}
// declare the drawCircle method
private void drawCircle (Graphics page,int left,int right,int circumf,Color circle_color,int center)
{
// set color based on inputed value
page.setColor(circle_color);
// draws a filled circle based on inputed values
page.fillOval(left,right,circumf,circumf);
// labels the circle with its score and then increments score
page.setColor(Color.black);
page.drawString(""+score,left+5,center);
score=score+10;
}
// declare the drawTarget method
private void drawTarget (Graphics window,int xcenter,int ycenter,int size)
{
// draws 3 concentric filled ovals using drawCircle method
drawCircle(window,xcenter-size/2,ycenter-size/2,size,Color.red,ycenter);
drawCircle(window,(xcenter-size/2)+(size/8),(ycenter-size/2)+(size/8),size-(size/4),Color.green,ycenter);

drawCircle(window,(xcenter-size/2)+(size/4),(ycenter-size/2)+(size/4),size-(size/2),Color.blue,ycenter);
}
} 
