please help with this homework, thanks !! NAME CSC 236- ArrayList and Generics c
ID: 3882881 • Letter: P
Question
please help with this homework, thanks !!
Explanation / Answer
5)adding integrs to arrraylist.
//create the list with the ArrayList and add the elements.
6)To display the size of ArrayList
//list.size() ->used to find the arraylist size.
7)using for loop to cycle through the elements
8)find average:
float avg= average(list) // call method average with parameter Integer ArrayList list
//average function. compute the average and return the value.
total+=elem;
}
avg=(float)total / list.size();
return avg;
}
//any clarification please do comments
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.