Answer to Question #7252 in Programming & Computer Science for chris
Write the function product which consumes a list of numbers and returns the product of those numbers. Make sure you follow the design recipe!
1
2012-03-13T08:05:12-0400
This is example on Java:
int f(LinkedList<Integer> list){
int res = 1;
for(Integer element : list){
res *= element;
}
return res;
}
//...
LinkedList<Integer> l1 = new LinkedList<Integer>();
l1.add(2);
l1.add(3);
l1.add(4);
int product = f(l1);
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Comments
Leave a comment