September 2015
Beginner
110 pages
2h 6m
English
| 21 | Numbers to Names |
Many programs display information to the end user in one form but use a different form inside the program. For example, you may show the word Blue on the screen, but behind the scenes you’ll have a numerical value for that color or an internal value because you may need to represent the textual description in another language for Spanish-speaking visitors.
Write a program that converts a number from 1 to 12 to the corresponding month. Prompt for a number and display the corresponding calendar month, with 1 being January and 12 being December. For any value outside that range, display an appropriate error message.
| | Please enter the number of the month: 3 |
| | The name of the month is March. |
Use a switch ...
Read now
Unlock full access