Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am currently trying to learn java and 1 of the questions in my book is to "Compute the product of the elements in the array", I don't understand what the term product mean in this context,can someone explain this to me using any type of data list (example 1,2,3,1,2,3)

The Question in the book.
Using the data list given below to initialise an array, write programs to solve the problem
Compute the product of the elements in the array;
using the data list: 2, 4, 6, 9, 5, 4, 5, 7, 12, 15, 21, 32, 45, 5, 6, 7, 12.
Posted
Updated 26-Nov-13 7:21am
v2
Comments
Sergey Alexandrovich Kryukov 26-Nov-13 13:16pm    
Sorry, no. You did not even provide a link to the text you refer to, no quotation. If feels like you believe we can read your mind...
—SA
olivergrayson 26-Nov-13 13:25pm    
my apologies. I hope this clears it up a little.
Sergey Alexandrovich Kryukov 26-Nov-13 13:30pm    
No problem; thank you for your clarification. I answered.
—SA
Sergey Alexandrovich Kryukov 26-Nov-13 13:25pm    
Are you sure that this is the exact quotation. The text does not look 100% literate.
—SA
olivergrayson 26-Nov-13 13:29pm    
the exact quotation is plural, but i only need help in one question.
"Using the data list given below to initialise an array, write programs to solve each of the following problems:" there is then 6 questions located under it.

1 solution

Thank you for clarification. If this is a precise quote from the book, I would not like such a book. You can always try to find a book where the exercises are formulated more accurately.

Anyway, it looks like the problem requires to find the product of all the numbers in the given list, like 2 * 4 * 6 * 8 ... * 7 * 12. Of course, these numbers should not be hard-coded, but takes from the list, no matter what the current content of the data in the list is.

—SA
 
Share this answer
 
v5
Comments
olivergrayson 26-Nov-13 13:34pm    
So in basic terms does product means multiplication?
Sergey Alexandrovich Kryukov 26-Nov-13 14:05pm    
Certainly, 100% :-)
Are you going to accept the answer formally now (green "Accept" button)?
—SA
olivergrayson 26-Nov-13 14:13pm    
Yes, Thanks for the help.
Sergey Alexandrovich Kryukov 26-Nov-13 14:25pm    
You are welcome.
Good luck, call again.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900