Challenge 5

👦🏻

What's your name?

Open in Code Editor or Copy Instructions
...solutions at bottom of page...

Repeatedly ask the user to enter their name, until they enter a non-empty value

You may wish to provide validation - ensuring they enter characters in the set {a-z,A-Z, } is quite easy...if you would like to try non-Latin characters, the following resource is useful: Unicode code blocks

Examples:

An input of "Fred Bloggs" would be accepted

An input of "123!" would be rejected

Extension:

Sometimes names are written with commas like "Bloggs, Fred" - modify your program so it accepts this

Correctly-capitalise the names - e.g. an input of "frEd bloGgS" would be modified/stored/output to the user as Fred Bloggs

Solutions

IGCSE 0478 / O-Level 2210 A-Level 9618