nova2177
Jul 12, 2008, 03:48 PM
how do you extract a module from a pseudo-code algorithm.
I'm not sure if I can post the question here but here goes.
a) write an algorithm that will display the sum for a given numbers of squares, e.g. if the user enter the value 3, then the output should be 1² + 2² + 3² = 14
b) from (a) use a module called sumsquare that will accept an integer value and return the sum of the squares of the value entered
c) use the sumsquare module to write an algorithm that will perform the same function as (a)
I think I figured out (a) but I have never done modules, I only know what it is. If some one can help me out, please help, show me an example of some sort, doesn't have to be the question that I post.
thanks.
I'm not sure if I can post the question here but here goes.
a) write an algorithm that will display the sum for a given numbers of squares, e.g. if the user enter the value 3, then the output should be 1² + 2² + 3² = 14
b) from (a) use a module called sumsquare that will accept an integer value and return the sum of the squares of the value entered
c) use the sumsquare module to write an algorithm that will perform the same function as (a)
I think I figured out (a) but I have never done modules, I only know what it is. If some one can help me out, please help, show me an example of some sort, doesn't have to be the question that I post.
thanks.