work1#379
Open
clz-clz wants to merge 2 commits into
Open
Conversation
Moon-Meld
reviewed
Oct 27, 2025
| throw new AnimalNotFoundException("店内没有动物可以出售!"); | ||
| } | ||
| customers.add(customer); | ||
| Animal animalToSell = animals.remove(0); // 卖掉第一只动物 |
Collaborator
There was a problem hiding this comment.
这里可以可以改成根据顾客选择的类型去售卖动物,而不是固定只卖列表的第一只
| for (Customer customer : customers) { | ||
| System.out.println(customer); | ||
| } | ||
| System.out.println("今天的利润是: " + balance); |
Collaborator
There was a problem hiding this comment.
这里的balance是店铺的余额 而不是一天当中的纯利润吧
Moon-Meld
reviewed
Oct 27, 2025
| public void closeShop() { | ||
| if (isOpen) { | ||
| System.out.println("店铺歇业,今天光顾的顾客有:"); | ||
| for (Customer customer : customers) { |
Collaborator
There was a problem hiding this comment.
歇业时,也应该清空当天的列表,这样第二天就不会再重复打印前一天的顾客
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
complete work1