Skip to content

Conversation

@Hedbom98
Copy link

No description provided.

Mattias Hedbom added 30 commits January 10, 2025 13:03
…lings/ bagels etc.

Also changed the return-value of showAllFillingsWithCosts()
…so identified an error in my domain model that I corrected.
…hus I created two new classes and deleted the "extension-code" from the core exercise
Mattias Hedbom added 11 commits January 14, 2025 11:02
…ne used for the extension (1 & 2). Also updated the domain model with the receipt class
totalCostWithDiscounts()
costWithDiscounts()

Updated the totalCostWithDiscounts() from the first extension so it accepts a HashMap instead. Created new tests for this new method
…hod, therefore I needed to slightly change the domain model, the test and lastly the method
String allFillingsWithPrices = "";
for(Item anItem : this.itemsOnMenu){
if(anItem.getTypeOfItem().equals("Filling")){
allFillingsWithPrices += anItem.getName() + ", " + anItem.getPrice() + "$\n";

Choose a reason for hiding this comment

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

Use stringbuilder in place of concatenating strings in a loop, as strings are immutable, so a new string will be created at each iteration

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