Describe an algorithm using pseudocode that takes a list of n integers a1, a2, ..., an, and returns the product of the positive integers. Be sure to initialize the variables. This doesn't have to be...


Describe an algorithm using pseudocode that takes a list of n
integers a1, a2, ..., an, and returns the product of the positive integers. Be sure to initialize the
variables. This doesn't have to be really long but just simple pseudocode. Here is what I have:


procedure product (a1, a2,...,an: positive integers)


product:=a1


     for i=1 to n


          If product < ai="" then="" product:="">


                    Return product {product is positive integers}



I'm not really sure if I'm right but the assignment wants a format similar to this. Please let me know what I need to change.



Jun 06, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here