A0W0N
Badges: 9
Rep:
?
#1
Report Thread starter 8 months ago
#1
I have this question which I’m stuck in and don’t know the answer to my guess is that rear and front are part of the parameter but I’m not sure I’ll post the question below appreciate any help
0
reply
A0W0N
Badges: 9
Rep:
?
#2
Report Thread starter 8 months ago
#2
Name:  image.jpg
Views: 11
Size:  100.1 KB
0
reply
Strange5050
Badges: 16
Rep:
?
#3
Report 8 months ago
#3
The 'parameter' in the example you've posted is 'item'. Parameters are the arguments or 'values' that are passed into functions/methods (in your example its called a procedure). You've made an easy mistake by looking and thinking that 'front' and 'rear' are the parameter(s), from what I can tell these are variables, that in this case are being used as 'indexers' , which are used to access the value at a certain position in a linear data structure (such as queue from your example).
Last edited by Strange5050; 8 months ago
0
reply
A0W0N
Badges: 9
Rep:
?
#4
Report Thread starter 8 months ago
#4
(Original post by Strange5050)
The 'parameter' in the example you've posted is 'item'. Parameters are the arguments or 'values' that are passed into functions/methods (in your example its called a procedure). You've made an easy mistake by looking and thinking that 'front' and 'rear' are the parameter(s), from what I can tell these are variables, that in this case are being used as 'indexers' , which are used to access the value at a certain position in a linear data structure (such as queue from your example).
So the procedure is the parameter?
0
reply
Strange5050
Badges: 16
Rep:
?
#5
Report 8 months ago
#5
(Original post by A0W0N)
So the procedure is the parameter?
No, all a procedure is, is a way to execute some code, the keyword 'procedure' is used to define some code that is 'seperate' from the main body of code. A parameter is a value that the code within a 'procedure' can use. Let's imagine we had the following:
Code:
procedure less_than_ten (number) // 'number' is the parameter.

    if number < 10
    // Do something
    else number > 10
    // Do something
    endif

endprocedure
In the simplified example above, the procedure is the code that is executed when 'less_than_ten()' is called, in this case the code that ran is the 'if-statement' which as you can see has two different outcomes. The parameter is number in this case, this is because 'number' is the value that the procedure takes as an 'arguement'. The procedure here will always execute the same code, but the result of calling this procedure may be different because the parameter (number) can be different (it might be less than 10, or greater than 10).

To simplify is down to its bare bones - Parameters are what are between the brackets after the procedure name that can be used or referred to in the code that the procedure contains.

I don't know whether I've made this clear, try this link, as it should be helpful: https://www.bbc.co.uk/bitesize/guide...kqt/revision/4 Apologies if I have confused you further.
Last edited by Strange5050; 8 months ago
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Should there be a new university admissions system that ditches predicted grades?

No, I think predicted grades should still be used to make offers (675)
33.62%
Yes, I like the idea of applying to uni after I received my grades (PQA) (856)
42.63%
Yes, I like the idea of receiving offers only after I receive my grades (PQO) (386)
19.22%
I think there is a better option than the ones suggested (let us know in the thread!) (91)
4.53%

Watched Threads

View All