Pseudocode FAQ
This is essentially an archive of old newsgroup questions that we thought
you might find useful.
- 6.1 ~ What is a module and when should I use them?
- 6.2 ~ What is the calling module?
- 6.2 ~ What is a parameter?
- 6.2 ~ Are out parameters considered to be zero before any value is assigned to them? Or does a value have to be specified before you can do something with it?
- 6.2 ~ What is the interaction between the formal and actual parameters? Are they the same thing or something different? Do the names of the variables just change names when passes in essentially?
- 6.2 ~ If I declare my variable for the character-to-be-read locally inside my module, what happens to it each time the module is called again? Will it effectively erase and re-create the variable place to be used to read the
next character, or will it screw up?
- 6.2 ~ When should I choose to use a procedure rather than a function?
- 6.2 ~ When do I use "in", "out" and "in/out" parameters?
- 6.2 ~ Are variables local to a module or are they global to everything?
- 6.2 ~ Can a module be declared with no parameters?
- 6.2 ~ Can variables be declared in the formal parameter list and not be in the actual parameter list?
- 6.2 ~ If the formal and actual parameter are called the same thing, are they different variables or are they the same?
- 6.2 ~ Is there a difference between the "returnsa" statement and the use of an out parameter? Are they interchangeable?
- 6.2 ~ What are the pre- and post- conditions?
- 6.3 ~ Can you end a procedure inside of an
if/then statement
- 6.3 ~ Can procedures be printed like functions can?
- 6.3, 6.4 ~ What is meant by a "module header"?
- 6.3, 6.4 ~ When a question says that a module "returns a value", am I supposed to take that as meaning that a parameter is passed out or could it mean that the value is somehow returned to the calling module (i.e. a funct
ion resolving to the needed value)?
- 6.3, 6.4 ~ Where do you declare modules, inside or outside the algorithm?
- 6.3, 6.4, 6.5, 6.6 ~ How do I declare and use modules in an algorithm?
- 6.4 ~ Can a Function have an "out" parameter in it?
- 6.4 ~ Can a function be printed directly?
- 6.4 ~ Can a function have more than one "in" parameter?
- 6.4 ~ If I have a function returns statement (in an if statement) in the middle of a loop and the condition becomes true, will the function just return the value and forget about everything else inside the code or would that
cause some kind of problem?
- 6.4 ~ If I change the value of a variable within a function and then return the variable will I be changing the outside world? In essence what I'm saying is can I change return a variable if I changed the value of it?
- 6.4 ~ Can an arithmetic statement be returned from a function?
- 6.4 ~ Can a function return an entire array, or just one array element?
- 6.4 ~ Does a function have to return something?
- 6.4 ~ Can a function call another function?
- 6.4 ~ Can we call a function to execute without assigning it value to anything?
- 6.4 ~ Can a function receive several values even though it only resolves to one single value?
- 6.4 ~ Can in parameters of a function be modified?
- 6.4 ~ Can a function have a pointer as a parameter?
- 6.5 ~ How is a procedure and function called from the algorithm or another calling module? Is it necessary to assign a procedure to a variable?
- 6.5 ~ Can a function call a procedure?
- 6.5 ~ What's the difference between a module, which takes in three numbers and a module is passed three numbers?
- 6.5 ~ What does it mean to return something to the calling algorithm or module?
- 6.6 ~ How do I trace my algorithm to make sure that it works right?
- 6.7 ~ Can recursion be used for something other than mathematical operations? If so, then how can do we use it?
- 6.7 ~ When doing recursion, is it ok to add or subtract to a variable in the procedure being re-called?
- 6.7 ~ In a procedure, if you run that same procedure but then have another command below where you recall that procedure does it finish the procedure before running the command below it?
- 6.7 ~ What is recursion? At least not from a computer science point of view.
- 6.7 ~ How do I keep track of the number of times my procedure has called itself?
- 6.7 ~ I understand recursion but only with numbers, what about other cases?
- 6.7 ~ Is it ok to use recursion and iteration in the same problem?
- 6.7 ~ Can I say something like: My_function returns My_function (something)?