Compiler: "The program should read from the keyboard the name of the month and display its number on the screen according to the specified template."
package com.codegym.task.task08.task0828;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.io.IOException;
/*
Month number
*/
public class Solution {
public static void main(String[] args) throws IOException {
//write your code here
String[] listMassiv = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
ArrayList<String> list = new ArrayList<String>(Arrays.asList(listMassiv));
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String str = reader.readLine();
for (int i = 0; i < list.size(); i++) {
if (str.equals(list.get(i))) {
System.out.println(list.get(i) + " is month " + (i-1));
}
}
}
}