Hello Everyone,
I am having major problems with my code and I was wondering if someone could please help me out because I have been trying for a very long time to fix the problems, but really have no clue what to do. I am trying to write a program where members of a team each have a certain number of points ,but then they each get a percentage of their points deducted based on a formula. I already calculated how much each teammate gets deducted in a class and used a helper method called deduction(). Now, I want to put each teammate in an array list and have the deductions of each teammate in the array list. I then want the deductions to be added together to give me the total deductions of the team. However, I really don't know how to use array lists. Can anybody PLEASE help me?
import java.util.ArrayList; public class Team { ArrayList Teammember = new ArrayList(); public void teammemb(points teammember) { Teammmember.add("mark"); Teammember.add("kevin"); Teammember.add("keith"); Teammember.add("eric"); team bluebirds = new team bluebirds; } public double totalDeductions() { for(int i = 0; i < Teammember.size(); i++){ points teammember = (points) Teammember.get(i); } return Teammember.Deductions; }