자바 코드 작성 오류 .. 도와주세요 ㅠㅠ

조회 1,307 · 댓글 0
먀먕이97작성자2019년 4월 11일
월 하나를 예를들어 March를 입력햇을때[color=red] March[/color]가 아닌 march나 MaRch 등 대소문자가 섞여있어도 "봄입니다"가 나와야하는 건데요..
안되네요 ㅠㅠ 뭐가 잘못 된 거 일까요 ..?

import java.util.Scanner;
public class NumericTypeTest {
private static final char [] MtoS = null;
static void UpperCase(char [] month) {
for(int i = 0; i < month.length; i++)
if (month[i] >= 'a' && month[i]<='z')
month[i] = (char)(month[i]-('a'-'A'));

}

static void LowerCase(char [] month) {
for(int i = 0; i < month.length; i++)
if( month[i] >= 'A' && month[i]<='Z')
month[i] = (char)(month[i]+('a'-'A'));
}

static void printCharArray(char [] month) {
for(int i = 0; i < month.length; i++)
System.out.print( month[i]);
System.out.println();
}


public static void main(String args[])
{
Scanner stdin = new Scanner(System.in);
System.out.print("월을 입력하세요(영문자) : ");
String month = stdin.next();
String MtoS;


switch (month)
{

case "December":
case "January":
case "February":
MtoS = "겨울입니다.";
break;

case "[color=red]March[/color]":
case "April":
case "May":
MtoS = "봄입니다.";
break;

case "June":
case "July":
case "August":
MtoS = "여름입니다.";
break;

case "September":
System.out.print("멋진 9월과 ");
case "October":
System.out.print("아름다운 10월과 ");
case "November":
System.out.print("낙엽의 11월은 ");
MtoS = "가을입니다.";
break;


default:
MtoS = "1~12월을 벗어난 달입니다.";
break;
}
System.out.println(MtoS);
stdin.close();
}
}

로그인 후 답글을 남길 수 있습니다.