Challenge: Concatenating Strings
Solve the challenge to check your understanding of concatenating strings.
We'll cover the following
Requirements
Write a pseudocode example in which the user’s first and last name is provided. The code outputs a greeting message that includes their first name. For example, if the user’s first name is “John” and their last name is “Doe,” the output should be "Hello, John Doe!"
and "How are you doing Doe?"
.
Your pseudocode should perform the following steps:
- Ask the user to enter their first and last name and store them in separate variables called
firstName
andlastName
. - Concatenate the
firstName
andlastName
variables with the greeting message"Hello, "
and an exclamation point. Store the result in a variable calledgreeting
. - Concatenate the
lastName
variable with the message"How are you doing"
and a question mark. Store the result in a variable calledinquiring_health
. - Print the
greeting
andinquiring_health
variables to the console.
You can use the space provided below to write your pseudocode.
Get hands-on with 1400+ tech skills courses.