java - Java停车系统:按客户ID和计费月份检索停车交易列表的方法
问题描述
这是我在这里的第一篇文章,我正在尝试为一个类项目编写一个方法。该项目是用Java编写一个停车系统。该方法应该按客户 ID 和计费月份返回停车交易列表。以下是我迄今为止的尝试。Eclipse 在第 5 行列出了一些错误,如下所示。错误;
Multiple markers at this line
- Syntax error, insert ">" to complete ReferenceType1
- Syntax error, insert "SimpleName" to complete QualifiedName
- Syntax error on token ")", delete this token
- Syntax error on token ".", @ expected after this token
- Syntax error, insert "VariableDeclarators" to complete
LocalVariableDeclaration
旧代码;
// Prints a list of transactions by customer id and month
public void getMonthlyBillbyCustomerId(int searchId) {
System.out.println("Your parking transactions for: ");
for (Customer customer : listOfCustomers) {
int i=0; i < monthlyBillbByCustomerId.size(); i++);
if (customer.getCustomerId() == (searchId));
if (transaction.getParkingDate() == (searchMonth)
System.out.println((i+1) + ". Name: " + monthlyBillByCustomerId.get(i).getCustomerId() +
", ID: " + listOfCustomers.get(i).getCustomerId()));
}
}
新代码;
// Prints a list of transactions by customer id and month
public void getMonthlyBillbyCustomerId(int searchId) {
System.out.println("Your parking transactions for: ");
for (int i=0; i < monthlyBillByCustomerId.size(); i++) {
for (Customer customer : listOfCustomers) {
if (customer.getCustomerId() == (searchId) && Transaction.getParkingDate(searchTransactions) == (searchMonth)) {
System.out.println((i+1) + ". Name: " + monthlyBillByCustomerId.get(i).getCustomerId() +
", ID: ");
}
}
}
解决方案
推荐阅读
- python - 自定义损失问题:急切执行函数的输入不能是 keras 符号张量但发现
- firebase - Firestore 禁用来自 Web 管理控制台的写入权限
- php - 强制下载 CSV 文件的问题 | PHP
- javascript - 在按钮单击 Toast UI Image 时调用图像
- c# - 无法从扩展类中获得价值,这是为什么呢?
- ruby-on-rails - Rails:截断文本输入而不是抱怨它太大了
- smalltalk - 如何在 Roassal 3 中为复合形状添加边界框?
- jsp - JSF h 和 f 标记未呈现
- javascript - 从 POST 接收 Axios 响应
- postgresql - 无法通过 Spring Boot 将 Docker Desktop Kubernetes (Windows) 服务连接到本地 Postgres db