Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello World Hello, World! is the traditional first program for beginning programming in a new language. Specification Write a Hello World! function that can greet

Hello World
"Hello, World!" is the traditional first program for beginning programming in a new language.
Specification
Write a Hello World! function that can greet someone given their name. The function should return the appropriate greeting.
For an input of "Alice", the response should be "Hello, Alice!".
If a name is not given, the response should be "Hello, World!"
This function will be a class level method on a HelloWorld class. It will be called like this from the tests:
HelloWorld.hello
HelloWorld.hello('Alice')
Test-Driven Development
As programmers mature, they eventually want to test their code.
At Exercism we simulate Test-Driven Development (TDD), where you write your tests before writing any functionality. The simulation comes in the form of a pre-written test suite, which will signal that you have solved the problem.
It will also provide you with a safety net to explore other solutions without breaking the functionality.
A typical TDD workflow on Exercism:
Run the test file and pick one test that's failing.
Write some code to fix the test you picked.
Re-run the tests to confirm the test is now passing.
Remove "skip" from one of the other included tests.
Repeat from step 1.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions