008-001-003

Method Basics: Greeting Method

Medium

Problem Description

method Basics: Greeting method

In this problem, you will create a program that defines a method accepting a name as a parameter and returning a greeting string, then displays the result to standard output.

Learning Objective: Define a method that takes parameters and returns a value

Create a greeting method. Implement a method that takes a name and returns a greeting.

Input

Line 1: Name (string)

Output

Input name: [name]
Greeting: Hello, [name]!

Ready to Try Running Code?

Log in to access the code editor and execute your solutions for this problem.

Don't have an account?

Sign Up