java需要英语_简单的java程序,需要懂英文

展开全部

你怎么又问了一题?这个是1-12转换成英文的月份,这个没难度的62616964757a686964616fe78988e69d8331333363373666public class NumOfMonth {

public static void main(String[] args) {

int num = Integer.parseInt (JOptionPane.showInputDialog ("Enter any number equal to or between 1-12 to display the month"));

switch (num)

{

case 1:

System.out.println ("The name of month number 1 is January");

break;

case 2:

System.out.println ("The name of month number 2 is February");

break;

case 3:

System.out.println ("The name of month number 3 is March");

break;

case 4:

System.out.println ("The name of month number 4 is April");

break;

case 5:

System.out.println ("The name of month number 5 is May");

break;

case 6:

System.out.println ("The name of month number 6 is June");

break;

case 7:

System.out.println ("The name of month number 7 is July");

break;

case 8:

System.out.println ("The name of month number 8 is August");

break;

case 9:

System.out.println ("The name of month number 9 is September");

break;

case 10:

System.out.println ("The name of month number 10 is October");

break;

case 11:

System.out.println ("The name of month number 11 is November");

break;

case 12:

System.out.println ("The name of month number 12 is December");

break;

default:

System.out.println ("You have entered an invalid number");

}

} // main method

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值