Ask Question
8 April, 12:40

You have just starting working at Quantum Company. As a new programmer, you have been asked to review and correct various pseudocode. The following pseudocode is not working correctly. What code needs to be corrected? This is the call to the method: displayName () And this is the method: displayName (string name) output "My name is " name returnA. Change the method call to displayName ("Sean")

B. Change the method call to displayName (Sean)

C. Change the return statement to return output

D. Change the return statement to return name

+5
Answers (1)
  1. 8 April, 16:19
    0
    Option A: Change the method call to displayName ("Sean")

    Explanation:

    The function displayName (string name) expects an input string to be passed to its parameter name. The original pseudocode that call to the method, displayName () doesn't include an argument within the parenthesis. When the function is called, no value will be passed to the parameter name. This will make the name become undefined.

    To fix the problem we need to include a string argument inside the parenthesis when calling the function displayName () so that the string argument (e. g. "Sean") will be passed to the parameter name and then the function will operate on the name and display it.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “You have just starting working at Quantum Company. As a new programmer, you have been asked to review and correct various pseudocode. The ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers