What's new

Closed Parameter and variable

Status
Not open for further replies.

sobciana

Addict
Joined
Aug 30, 2017
Posts
108
Reaction
27
Points
101
Hello po mga sir. Gusto ko lang po malaman kung anong ang pinagkaiba nila sa sarili nyo pong explanation at pagkakaintindi
 
Hirap iexplain.. sana maintindihan mo
Let's say
Code:
int i = 7;
That in itself is just a variable, because as you know it stores values, however put it in this way
Code:
void myFunction (int i) {
    //Some code
}
The variable is now a parameter, since the values inside the variable may dictate how the function is run.

In other words, a parameter is a conditioning variable to a function. It is mostly called arguments tho in programming.

Sensya if nakakalito.. I'm not good at explaining kase eh :) that's just from my experience tho so don't take it as an accurate explanation.

Note that this is for programming... I don't know if this explanation applies to others (e.g statistics)
 
Last edited by a moderator:
Alam ko din kasi kung paano sya ginagamit. Kasi kapag nagtatanong
Hirap iexplain.. sana maintindihan mo
Let's say
Code:
int i = 7;
That in itself is just a variable, because as you know it stores values, however put it in this way
Code:
void myFunction (int i) {
    //Some code
}
The variable is now a parameter, since the values inside the variable may dictate how the function is run.

In other words, a parameter is a conditioning variable to a function. It is mostly called arguments tho in programming.

Sensya if nakakalito.. I'm not good at explaining kase eh :) that's just from my experience tho so don't take it as an accurate explanation.

Note that this is for programming... I don't know if this explanation applies to others (e.g statistics)

Alam ko din po sya kung paano gagamitin at kaso kapag explanation na po sa ibang tao nahihirapan ako. Same po tayo ng thoughts. sana may explanation pa po na mas mababaw. Thanks
 
Last edited by a moderator:
Alam ko din kasi kung paano sya ginagamit. Kasi kapag nagtatanong


Alam ko din po sya kung paano gagamitin at kaso kapag explanation na po sa ibang tao nahihirapan ako. Same po tayo ng thoughts. sana may explanation pa po na mas mababaw. Thanks
Haha sabihin mo nlang na special type of variable siya, only used in passing values inside a function
 
másáráp na Crispy Pata

INGREDIENTS:
- 2 kg - paa ng baboy
- 2 cups - cooking oil
- 1 cup - vinegar
- 1/2 teaspon - paminta
- 1 clove - sibuyas
- 1 clove - bawang
- 1 cup - salt
********these numbers are PARAMETERS...para sa isang másáráp ng Crispy Pata. You change any of these PARAMETERS, mag iiba ang lasa ng crispy pata.


HOW TO COOK
Pakuluan at palambutin ang paa na baboy sa kumulong tubig na may temperature na 200 degrees (temperature variable) for about 10 minutes (time variable). Sa kalagitnaan bago lumambot, hinaan mo ang apoy para ang tubig ay nasa 100 degrees lang. Pakulaan ng mga 5 more minutes (time variable).
Ilagay ang mga sangkap at pakuluaan uli with water temperature of 70 degrees (temprature variable) for about 30 minutes (time variable).
*******and that's variable(s)... it "varies"....

------ANOTHER ANALOGY-----
Cup of Coffee

Parameters:
1 cup of hot water
1/2 spoon nescafe
1 spoon sugar

Variable:
Taste = perfect coffee

If you change parameter to 2 spoons of sugar
Variable:
Taste = too sweet

Make parameter hot water to 3 cups
Taste = too plain
 
Last edited:
másáráp na Crispy Pata

INGREDIENTS:
- 2 kg - paa ng baboy
- 2 cups - cooking oil
- 1 cup - vinegar
- 1/2 teaspon - paminta
- 1 clove - sibuyas
- 1 clove - bawang
- 1 cup - salt
********these numbers are PARAMETERS...para sa isang másáráp ng Crispy Pata. You change any of these PARAMETERS, mag iiba ang lasa ng crispy pata.


HOW TO COOK
Pakuluan at palambutin ang paa na baboy sa kumulong tubig na may temperature na 200 degrees (temperature variable) for about 10 minutes (time variable). Sa kalagitnaan bago lumambot, hinaan mo ang apoy para ang tubig ay nasa 100 degrees lang. Pakulaan ng mga 5 more minutes (time variable).
Ilagay ang mga sangkap at pakuluaan uli with water temperature of 70 degrees (temprature variable) for about 30 minutes (time variable).
*******and that's variable(s)... it "varies"....

------ANOTHER ANALOGY-----
Cup of Coffee

Parameters:
1 cup of hot water
1/2 spoon nescafe
1 spoon sugar

Variable:
Taste = perfect coffee

If you change parameter to 2 spoons of sugar
Variable:
Taste = too sweet

Make parameter hot water to 3 cups
Taste = too plain

So parang ganito po ang pagkakaintindi ko po sa explanation nyo po. Pwedeng magbago ang result ng variable depende sa value ng parameter
 
Pasensya na po mga boss. Gusto ko lang magkaroon ng madaling explanation na pwede kong gamitin sa kapag nagexplain po ako sa iba
 
May tanong ako ts, ginagamit o nagamit mo na ba sa pag proprogram mo mga yan? Kase mas madali mong ma differentiate at matutunan kung may experience ka na kung papaano gamitin mga yan. :)
 
Last edited by a moderator:
Idaan natin sa panliligaw sa babae

PARAMETER

Kailangan mong maging mayaman para maligawan mo ang babae

VARIABLE

Manliligaw ka sa isang babae at ikaw ay isang mayaman.
 
So parang ganito po ang pagkakaintindi ko po sa explanation nyo po. Pwedeng magbago ang result ng variable depende sa value ng parameter

Yes.
AND also sa METHOD or FUNCTION na may required PARAMETER. Ang ire-return na value ay depende rin sa PARAMETER value.

In practice, parang ganito:

Code:
String hairColor = "black";

function changeHairColor(color1, color2){
   colorMix = color1 + color2;
   return colorMix;
}

hairColor = changeHairColor("red", "yellow");

print "Her hair color is: " + hairColor;

ang result nyan "Her hair color is: redyellow"

....so color1 and color2 are your parameters. FUNCTION process it and return the processed result.
 
Last edited:
May tanong ako ts, ginagamit o nagamit mo na ba sa pag proprogram mo mga yan? Kase mas madali mong ma differentiate at matutunan kung may experience ka na kung papaano gamitin mga yan. :)

Oo sir nagagamit ko sya sa pagpoprogram ko . May nagtanong lang kasi sa akin kung ano daw pinagkaiba ng parameter at variable hindi ko alam kung paano ko iexplain ng madali nyang maiintindihan.
 
Last edited by a moderator:
Oo sir nagagamit ko sya sa pagpoprogram ko . May nagtanong lang kasi sa akin kung ano daw pinagkaiba ng parameter at variable hindi ko alam kung paano ko iexplain ng madali nyang maiintindihan.

Parameters: variables pa rin sila sa totoo lang, pero DEPENDENT variables WITHIN sa scope lang ng function. So ibig sabihin hindi sila pwede gamitin ng iba pang function or OUTSIDE sa function at naka depende ang OUTPUT / RESULT ng isang function sa kanyang mga parameters. Parang sa math "f(x) or function of x" kung saan yung "x" is a paremeter variable. if x = 10; what is f(x) = x + 2 ? Di ba?
 
var a = 123; <-- variable

function abc(param){ <-- parameter

haha = param; <-- variable assignment
print(haha);

}

Ang variable any placeholder/reference ng value or object, while yung parameter is ung data na needed ng function/method.
 
Status
Not open for further replies.

Similar threads

Back
Top