• Home
  • Blog
  • Introduction to Programming Discussion

Introduction to Programming Discussion

0 comments

 

Answer this question after class, 

Respond to the posts of a couple of your classmates.

 

Week  Discussion

Sometimes, it’s a good idea to use “pass by value,” and leave the value of a variable unchanged.

Sometimes, it’s a good idea to use “pass by reference,” and have the called method change the value of a variable.

 

Can you think of an example of when “pass by reference” is a good idea? 

Please be very, very specific: Give the name of the variable, the name of the method, and the type of program.

 

Format: The variable <name of variable> could be modified by the method <name of method> in a <type of program> program.

 

Example: The variable “returnOnInvestement” could be modified by the method “CalculateProfitOrLoss” in a stock portfolio program.

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}