public double totalPackages(ArrayList List) { double total = 0; for (int i = 0; i < List.Count; i++) { CarOption carPack = (CarOption)List[i]; total += carPack.price; } return(total); }
//methods //adds a selected option to car option list public void addCarOption(CarOption myOption) { optionList.Add(myOption); }
public void removePackage(CarOption carOption) { packages.Remove(carOption); }
public void addPackage(CarOption carOption) { packages.Add(carOption); }