Skip to content

work1#379

Open
clz-clz wants to merge 2 commits into
west2-online-reserve:mainfrom
clz-clz:main
Open

work1#379
clz-clz wants to merge 2 commits into
west2-online-reserve:mainfrom
clz-clz:main

Conversation

@clz-clz

@clz-clz clz-clz commented Oct 26, 2025

Copy link
Copy Markdown

complete work1

throw new AnimalNotFoundException("店内没有动物可以出售!");
}
customers.add(customer);
Animal animalToSell = animals.remove(0); // 卖掉第一只动物

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里可以可以改成根据顾客选择的类型去售卖动物,而不是固定只卖列表的第一只

for (Customer customer : customers) {
System.out.println(customer);
}
System.out.println("今天的利润是: " + balance);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的balance是店铺的余额 而不是一天当中的纯利润吧

public void closeShop() {
if (isOpen) {
System.out.println("店铺歇业,今天光顾的顾客有:");
for (Customer customer : customers) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

歇业时,也应该清空当天的列表,这样第二天就不会再重复打印前一天的顾客

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants