|
You should recognize this as one of the algorithms discussed in the previous chapter. The algorithm is now contained in a method but the idea (the algorithm) is the same, as seen in the code below: | |
Using an Array ParameterHere is the completed program. The method is written using the parameter x to refer to the actual data that it will be supplied with. A method is written without referring to any particular data. The parameter x means "whatever data is supplied when the method starts to run." This might be different data at different times.
| |
QUESTION 3:Mentally alter the program by declaring a second array and printing it out. (Or better yet, copy the program, paste it to Notepad, and actually make the alterations.) Click Here after you have answered the question |