noel222
01-25-2012, 12:19 AM
I am trying to write a program that has 4 teammates. The first part of the code calculated the number of goals scored by each member. I then have to write a new class that puts each teammate in an arraylist and then has a method that calculated the combined number of goals of the 4 teammates. I am very lost and really don't even know where to start. Can someone please help me? Here is what I have so far. I already have a class that calculates the goals of each teammate.
import java.util.ArrayList;
public class team {
public void teammate(goals teammate){
ArrayList teammate = new ArrayList();
}
public double totalGoals() {
ArrayList teammates = new ArrayList();
for(int i = 0; i < teammate.size();i++){
Object t = teammate.get(i);
goals E = (goals) F;
}
return 0;
}
import java.util.ArrayList;
public class team {
public void teammate(goals teammate){
ArrayList teammate = new ArrayList();
}
public double totalGoals() {
ArrayList teammates = new ArrayList();
for(int i = 0; i < teammate.size();i++){
Object t = teammate.get(i);
goals E = (goals) F;
}
return 0;
}