Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

WGU Scripting and Programming Foundations Exam - Topic 1 Question 7 Discussion

Actual exam question for WGU's WGU Scripting and Programming Foundations exam
Question #: 7
Topic #: 1
[All WGU Scripting and Programming Foundations Questions]

What are two examples of valid function calls?

Choose 2 answers.

Show Suggested Answer Hide Answer
Suggested Answer: C, D

Comprehensive and Detailed Explanation From Exact Extract:

A valid function call invokes a function by its name, providing the required number and type of arguments in the correct syntax. According to foundational programming principles (e.g., Certiport Scripting and Programming Foundations Study Guide), function calls must follow the language's syntax rules, typically function_name(arguments).

Option A: 'function sample(float 2.0).' This is incorrect. This resembles a function definition (declaring a function named sample with a parameter), not a function call. A call would be sample(2.0).

Option B: 'GetHeight(integer 3, 4).' This is incorrect. The syntax integer 3 is invalid in most languages for a function call. A correct call might be GetHeight(3, 4), assuming GetHeight accepts two integers. The inclusion of type keywords (integer) is not typical in function calls.

Option C: 'round(4.723, 2).' This is correct. In languages like Python, round(4.723, 2) is a valid call to the built-in round function, which takes a float and an integer (number of decimal places) and returns a rounded value (e.g., 4.72).

Option D: 'PrintSample().' This is correct. Assuming PrintSample is a defined function with no parameters, PrintSample() is a valid call (e.g., in Python: def PrintSample(): print('Sample')).

Certiport Scripting and Programming Foundations Study Guide (Section on Functions and Function Calls).

Python Documentation: ''Built-in Functions'' (https://docs.python.org/3/library/functions.html#round).

W3Schools: ''C Functions'' (https://www.w3schools.com/c/c_functions.php).


Contribute your Thoughts:

0/2000 characters
Belen
15 days ago
Wait, is B even a valid function call? Sounds off.
upvoted 0 times
...
Carey
20 days ago
A is totally wrong, can't have a float like that.
upvoted 0 times
...
Tegan
26 days ago
Definitely agree with C!
upvoted 0 times
...
Gertude
1 month ago
C and D are valid calls!
upvoted 0 times
...
Mari
1 month ago
I thought GetHeight was a valid call too, but I can't remember if it should have a specific number of parameters.
upvoted 0 times
...
Merilyn
1 month ago
I feel like D is definitely a valid function call since it doesn't require any parameters.
upvoted 0 times
...
Salena
2 months ago
I'm not sure about A, but I remember something about function calls needing valid arguments.
upvoted 0 times
...
Mitsue
2 months ago
I think option C looks familiar because we practiced using the round function in class.
upvoted 0 times
...
Latonia
2 months ago
I feel like B is tricky; I can't recall if functions can take multiple parameters like that.
upvoted 0 times
...
Paul
2 months ago
I remember practicing similar questions, and I think D should also be valid since it has no parameters.
upvoted 0 times
...
Chauncey
2 months ago
I'm not so sure about A, it looks wrong to me because of the float argument.
upvoted 0 times
...
Kandis
2 months ago
I think option C is definitely a valid function call since it matches the round function's syntax.
upvoted 0 times
...

Save Cancel