Hello and good day! Hope someone can help me with the practical tasks.
Im so stuck and i have no idea how to move forward.
This is the task:
Hello you
Write a program that will read a name as input from the console and salute the person.
Input
- On the single line you will receive a name (ex: John)
Output
- You should print a salutation to the person (ex: Hello, John!)
Input
John
Output
Hello, John!
And this is my solution :
function greeting (name = ‘John’) {
print(Hello, ${name}!
)
}
greeting();
Ps. I’m using the proper syntax for string interpolation.
The system keeps rejecting it and i have no idea why.
I ran the code in VS Code and it works. So can somebody tell what I’m doing wrong?