Language:EN
Pages: 2
Words: 225
Rating : ⭐⭐⭐⭐⭐
Price: $10.99
Page 1 Preview
correct greeting procedure answer and explanation

correct greeting procedure answer and explanation

Correct Greeting Procedure Assignment Answers

Question:

A program's expected function is to return a greeting message, including the user's name. Review the AP Exam pseudocode code segment below. x ← INPUT() y ← greeting(x) DISPLAY(y) Which of the following is the correct implementation of the greeting() procedure? PROCEDURE greeting(name) { DISPLAY(Concat("Good Morning ", name)) } PROCEDURE greeting(x) { DISPLAY(Concat("Good Morning ", name)) } PROCEDURE greeting(name) { RETURN(Concat("Good Morning ", name)) } PROCEDURE greeting(name) { RETURN(Concat("Good Morning ", "name")) }

Correct Greeting Procedure Answer and Explanation

- This option has an issue. It uses the variable `name` without declaring it as a parameter or assigning it a value. It should be `x` instead.

3. PROCEDURE greeting(name) { RETURN(Concat("Good Morning ", name)) }

PROCEDURE greeting(name) {

DISPLAY(Concat("Good Morning ", name))

You are viewing 1/3rd of the document.Purchase the document to get full access instantly

Immediately available after payment
Both online and downloadable
No strings attached
How It Works
Login account
Login Your Account
Place in cart
Add to Cart
send in the money
Make payment
Document download
Download File
img

Uploaded by : Nitara Sundaram

PageId: DOCCD29708