?? count.java
字號(hào):
package com.jbaptech.accp.netbar.client;
//下機(jī)界面CheckOutDialog按下確定時(shí)調(diào)用此類的方法
public class Count {
public Count() {
}
public static int calFee(String beginTime, String endTime){
int fee = 0; //消費(fèi)金額
//從字符串形式的日期獲取年、月、日、小時(shí)、分
int beginYear = Integer.parseInt(beginTime.substring(0,4));
int beginMonth = Integer.parseInt(beginTime.substring(5,7));
int beginDay = Integer.parseInt(beginTime.substring(8,10));
int beginHour = Integer.parseInt(beginTime.substring(11,13));
int beginMinute = Integer.parseInt(beginTime.substring(14,16));
int endYear = Integer.parseInt(beginTime.substring(0,4));
int endMonth = Integer.parseInt(beginTime.substring(5,7));
int endDay = Integer.parseInt(beginTime.substring(8,10));
int endHour = Integer.parseInt(beginTime.substring(11,13));
int endMinute = Integer.parseInt(beginTime.substring(14,16));
//計(jì)算上機(jī)的時(shí)間,單位為分鐘
int playMinutes = 0;
playMinutes = ( (endYear - beginYear) * 365 * 24 * 60 +
(endMonth - beginMonth) * 30 * 24 * 60 +
(endDay - beginDay) * 24 * 60 +
(endHour - beginHour) * 60 +
(endMinute -beginMinute));
//計(jì)算費(fèi)用
int modNum = playMinutes % 60;
int playHours = 0;
playHours = playMinutes / 60;
if (playHours == 0 || (modNum > 5 && playHours > 0)){
playHours++;
}
fee = playHours * 2;
return fee;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -