Answer to Question #262861 in Algorithms for Dion Martins

Question #262861

Choose the correct answer



3 When a function receives a copy of the value stored in an argument used in the function call, it means the variable was _____.


a. pass by address


b. passed by value


c. passed by reference


d. assigned its original value when it was declared



Study the following function call in an algorithm:


Display “The results are”, getArea(len, wid)


2.4 Which of the following statements is also a valid function call?


a. if getArea (len, wid) = true then


b. if getArea (valLen, valWid) == true then


c. getrea (len, wid)


d. r = getArea(valLen, valWid )

1
Expert's answer
2021-11-09T10:21:05-0500
  1. Passing by address or by reference lets the function to gain access to memory address of the variable, so it receives the original value, not a copy. The correct answer is: b. Passed by value.
  2. Getting area of smth usually means receiving integer or float value of area. Statements A, B work with the result of the function as it is boolean, so the use of the function is incorrect. Statement C has a type, and that function will not be called. The correct answer is: d. r = getArea(valLen, valWid)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS