I've been asked to develop a simple program for my Java class which asks the user to input a number and based on the users response the corresponding month of the year should appear. This has to be achieved through the use of parallel arrays. The program is written in Notepad and compiled via CMD using the javac command. For some reason the code below gives me an error when I try to compile it any input or advice would be appreciated.
import java.util.Scanner;
/* Calender.java
* This program displays the month of the year based on the users input
* Date created: 5 May 2018 */
public class Calender
{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
String[] months = {"January", "February", "March", "April", "May", "June", "July, "August", "September", "October", "November", "December"};
int[] monthYear = {1, 2, 3, 4, 5 , 6, 7, 8, 9, 10, 11, 12};
int i;
System.out.print("Please enter a value to view the corrosponding month");
i = sc.nextInt();
for(i = 0; i <= 11; i++)
{
System.out.printf("Number %d: %s \n",months[i],monthYear[i]);
}
}
}