Skip to content
Advertisement

How to get my scanner to recognize the words i have for it

I’m pretty new to java and coding in general and am trying to figure out how to get this game to work for a project at school. It is meant for you to type in a month and it will then ask you to choose a day, however when I input a month it always just says its an invalid input, which is what I want it to do when it is not a valid month. What am I doing wrong?

JavaScript

Advertisement

Answer

try to test if contains the month list.contains() and the days in an other methode just call it

Advertisement