Coding Exercise: Arrays

Test yourself on the concept of Arrays.

We'll cover the following

Problem

In this exercise, an array stores months that are retrieved later. Write code for a console based “Months App” that meets the requirements listed below.

  1. If userResponse is a number from 112, display the month, like the following:
2 is February
  1. If userResponse contains Display All, display all months from the array on the console, like the following:
January
February
March
April
May
June
July
August
September
October
November
December
  1. If incorrect information is entered in userResponse, display a message saying,
Not a valid input

Sample input

The program accepts one string parameter, for example:

"8"

Expected output

The finished output of the program should look like the example below:

8 is August

Get hands-on with 1200+ tech skills courses.