MTEL Digital Literacy and Computer Science

Category - Digital Lit and CS

Use the pseudocode below to answer the question that follows.
1
      function calc_score(suit, value)
2             score = 0
3
4             if (suit is "heart" OR suit is "red")
5                    score = 2 * value
6             else
7                    score = value
8
9       return score
10
11     #main body of program
12
13    score = calc_score("heart", 4)
14    print(score)

Which line in the segment of pseudocode illustrates the passing of arguments?
  1. Line 1
  2. Line 2
  3. Line 9
  4. Line 13
Explanation
Correct Response: D. The function is called and actual arguments are passed. A is incorrect because the name and arguments of the function are defined but not called. B is incorrect because a local variable is initialized to the value 0. C is incorrect because the function returns a value to the variable on the line where the function was called. 
Was this helpful? Upvote!
Login to contribute your own answer or details

Top questions

Related questions

Most popular on PracticeQuiz