Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mattias Hedbom #137

Open
wants to merge 41 commits into
base: main
Choose a base branch
from
Open

Mattias Hedbom #137

wants to merge 41 commits into from

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