Ask Question

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. 2 June, 03:01
    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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers