S5來襲4/11旗艦上市金豪禮★拿現金最實在!法人:14檔今年本業虧定了破戒!比丘吃葷 連3次...
2012-01-22 16:08:27 人氣(328) | 回應(0) | 推薦(0) | 收藏(0) 上一篇 | 下一篇

[JAVA][作業練習] Lab7

0
收藏
0
推薦

Write a program that converts dates from numberical month/day/year
format to normal "month day, year" format (for example, 12/25/2000
corresponds to December 25, 2000). You will define three exception
classes, one called MonthException, another called DayException,
and a third called YearException. If the user enters anything other
than a legal month number (inegers from 1 to 12), your program will
throw and catch a MonthException and ask the user to reenter the
month. Similarly, if the user enters anything other than a valid
day number (integers from 1 to either 28, 29, 30, or 31, depending
on the month and year), then your program will throw and catch a
DayException and ask the user to reenter the day. If the user
enters a year that is not in the range 1000 to 3000 (inclusive),
then your program will throw and catch a Year-Exception and ask the
user to reenter the year. (There is nothing very special about the
numbers 1000 to 3000 other than giving a good range of likely dates.
) See Self-Test Exercise 19 in Chapter 4 for details on leap years.

下載 : 程式碼

台長:Morris
人氣(328) | 回應(0)| 推薦 (0)| 收藏 (0)| 轉寄
全站分類: 不分類 | 個人分類: [學習]Java |
此分類下一篇:[JAVA][作業練習] Lab10
此分類上一篇:[JAVA][作業練習] Lab6

我要回應
是 (若未登入"個人新聞台帳號"則看不到回覆唷!)
* 請輸入識別碼:
請輸入以下數字 (ex:123)

(有*為必填)
詳全文