You are on page 1of 1

/**

*
*
* @author Ryan Newman
* @version 09.07.2010
*/
public class Swimmer
{
// instance variables - replace the example below with your own
private String name;
private double heat, semiFinals, finals;
/**
* Constructor for objects of class Swimmer
*/
public Swimmer(String name, double heat, double semiFinals, double finals)
{
// initialise instance variables
this.name = name;
this.heat = heat;
this.semiFinals = semiFinals;
this.finals = finals;
}
/**
* An example of a method - replace this comment with your own
*
* @param y a sample parameter for a method
* @return the sum of x and y
*/
public double totalTime() {
return (heat + semiFinals + finals);
}
public double averageTime1() {
return ((heat + semiFinals + finals) / 3);
}
public double averageTime2() {
return totalTime() / 3;
}
public double getFinals() {
return finals;
}
public String getName() {
return name;
}

You might also like