1 Star 0 Fork 0

CS-IMIS-23/20172306

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Customer.java 1.34 KB
一键复制 编辑 原始数据 按行查看 历史
20172306 提交于 7年前 . 书上代码
package wek3;
/* **
* Customer represents a waiting customer.
*
* @author Lewis and Chase
* @version 4.0
*/
public class Customer
{
private int arrivalTime, departureTime;
/**
* Creates a new customer with the specified arrival time.
* @param arrives the arrival time
*/
public Customer(int arrives)
{
arrivalTime = arrives;
departureTime = 0;
}
/**
* Returns the arrival time of this customer.
* @return the arrival time
*/
public int getArrivalTime()
{
return arrivalTime;
}
/**
* Sets the departure time for this customer.
* @param departs the departure time
**/
public void setDepartureTime(int departs)
{
departureTime = departs;
}
/**
* Returns the departure time of this customer.
* @return the departure time
*/
public int getDepartureTime()
{
return departureTime;
}
/**
* Computes and returns the total time spent by this customer.
* @return the total customer time
*/
public int totalTime()
{
return departureTime - arrivalTime;
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/CS-IMIS-23/20172306.git
git@gitee.com:CS-IMIS-23/20172306.git
CS-IMIS-23
20172306
20172306
master

搜索帮助