永恆交界處

JAVA ex1

這學期又修了一門程式課,是資管系的必修Java。
其實這堂比C#程設好太多,還有教你如何環境建置。

我的環境是用Java SE 9.0.4
開發介面則是Eclipse 4.7.9

本次作業的內容是要計算兩個四位數時間的時間差,
一開始想得太簡單,
後來才想到要把小時跟分鐘分開處理,因為一個是二十四進位,一個是六十進位。

但後來有解決了

題目:

Requirements:
 • Write a class named TimeCalculator that reads two times in military format (0850, 1710) and prints the number of hours and minutes between the two times.
 • Generate complete Javadoc (e.g. import statement, class, method, comments, etc.) for the TimeCalculator class and place it in a folder named docs within the project
 • The program asks the user to input two times in military format, and then prints results
All input and output should be handled in TimeCalculator class. The main method should start by displaying these prompts in this exact format:
Please enter the first time:
Please enter the second time:
Read in the user input and execute the appropriate command, then display the result in this exact format:
The duration between these two times is (fill in your result) hours (fill in your result) minutes
 • The class Date in java.util.Date is not allowed in this assignment

我寫的結果

Facebook 粉絲專頁,賞個讚吧。<(_ _)>