Skip to content

Commit

Permalink
Merge pull request #108 from JeffinsonDarmawan/iotest
Browse files Browse the repository at this point in the history
iotest
  • Loading branch information
IanFH committed Apr 3, 2024
2 parents 6a497bb + 52c6b48 commit efed9d0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 18 deletions.
6 changes: 3 additions & 3 deletions docs/UserGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ Here are the list of commands you can use:
2. delete <bouquetName> - Delete a bouquets
3. mybouquets - List current saved bouquets
4. info <flowerName> - Provide information on chosen flower
5. add <flowerName> /q <quantity> /to <bouquetName> - add flower to a bouquet.
6. remove <flowerName> /q <quantity> /from <bouquetName> - remove flower from a bouquet.
5. add <flowerName> /q <quantity> /to <bouquetName> - add flower to a bouquet
6. remove <flowerName> /q <quantity> /from <bouquetName> - remove flower from a bouquet
7. flowers - Shows a list of flowers that can be added into mybouquets
8. flowers <occasion> - Shows a list of flowers associated with said occasion
9. occasion - Shows a list of occasions associated with available flowers.
9. occasion - Shows a list of occasions associated with available flowers
10. save <bouquetName> - Saves a bouquet to an external <bouquetName>.txt file
11. recommend - Recommends a bouquet based on the chosen occasion and colour
12. bye - Exits the programme
Expand Down
16 changes: 9 additions & 7 deletions src/main/java/florizz/core/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,12 @@ public void printAllBouquets(ArrayList<Bouquet> bouquetList){
System.out.println(i++ + ". " + bouquet + " :");
HashMap<Flower, Integer> flowerHashMap = bouquet.getFlowerHashMap();
totalPrice = 0;
if (!flowerHashMap.isEmpty()) {
if (!flowerHashMap.isEmpty() ) {
for (Flower j : flowerHashMap.keySet()) {
System.out.println(" - " + flowerHashMap.get(j) + " x " + j.getFlowerName());
totalPrice += (flowerHashMap.get(j) * j.getPrice());
if (flowerHashMap.get(j) != 0) {
System.out.println(" - " + flowerHashMap.get(j) + " x " + j.getFlowerName());
totalPrice += (flowerHashMap.get(j) * j.getPrice());
}
}
System.out.println(" Total estimated price = $" + String.format("%.2f", (double) totalPrice));
} else {
Expand Down Expand Up @@ -124,13 +126,13 @@ public void printHelpMessage() {
System.out.println("2. delete <bouquetName> - Delete a bouquets");
System.out.println("3. mybouquets - List current saved bouquets");
System.out.println("4. info <flowerName> - Provide information on chosen flower");
System.out.println("5. add <flowerName> /q <quantity> /to <bouquetName> - add flower to a bouquet.");
System.out.println("6. remove <flowerName> /q <quantity> /from <bouquetName> - remove flower from a bouquet.");
System.out.println("5. add <flowerName> /q <quantity> /to <bouquetName> - add flower to a bouquet");
System.out.println("6. remove <flowerName> /q <quantity> /from <bouquetName> - remove flower from a bouquet");
System.out.println("7. flowers - Shows a list of flowers that can be added into mybouquets");
System.out.println("8. flowers <occasion> - Shows a list of flowers associated with said occasion");
System.out.println("9. occasion - Shows a list of occasions associated with available flowers.");
System.out.println("9. occasion - Shows a list of occasions associated with available flowers");
System.out.println("10. save <bouquetName> - Saves a bouquet to an external <bouquetName>.txt file");
System.out.println("11. recommend - Recommends a bouquet based on the chosen occasion and colour.");
System.out.println("11. recommend - Recommends a bouquet based on the chosen occasion and colour");
System.out.println("12. bye - Exits the programme");
printBreakLine();
}
Expand Down
9 changes: 5 additions & 4 deletions text-ui-test/ACTUAL.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ Here are the list of commands you can use:
2. delete <bouquetName> - Delete a bouquets
3. mybouquets - List current saved bouquets
4. info <flowerName> - Provide information on chosen flower
5. add <flowerName> /q <quantity> /to <bouquetName> - add flower to a bouquet.
6. remove <flowerName> /q <quantity> /from <bouquetName> - remove flower from a bouquet.
5. add <flowerName> /q <quantity> /to <bouquetName> - add flower to a bouquet
6. remove <flowerName> /q <quantity> /from <bouquetName> - remove flower from a bouquet
7. flowers - Shows a list of flowers that can be added into mybouquets
8. flowers <occasion> - Shows a list of flowers associated with said occasion
9. occasion - Shows a list of occasions associated with available flowers.
9. occasion - Shows a list of occasions associated with available flowers
10. save <bouquetName> - Saves a bouquet to an external <bouquetName>.txt file
11. bye - Exits the programme
11. recommend - Recommends a bouquet based on the chosen occasion and colour
12. bye - Exits the programme
____________________________________________________________
What can I do for you?
Enjoy your bouquet! Thank you for using Florizz
Expand Down
9 changes: 5 additions & 4 deletions text-ui-test/EXPECTED.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ Here are the list of commands you can use:
2. delete <bouquetName> - Delete a bouquets
3. mybouquets - List current saved bouquets
4. info <flowerName> - Provide information on chosen flower
5. add <flowerName> /q <quantity> /to <bouquetName> - add flower to a bouquet.
6. remove <flowerName> /q <quantity> /from <bouquetName> - remove flower from a bouquet.
5. add <flowerName> /q <quantity> /to <bouquetName> - add flower to a bouquet
6. remove <flowerName> /q <quantity> /from <bouquetName> - remove flower from a bouquet
7. flowers - Shows a list of flowers that can be added into mybouquets
8. flowers <occasion> - Shows a list of flowers associated with said occasion
9. occasion - Shows a list of occasions associated with available flowers.
9. occasion - Shows a list of occasions associated with available flowers
10. save <bouquetName> - Saves a bouquet to an external <bouquetName>.txt file
11. bye - Exits the programme
11. recommend - Recommends a bouquet based on the chosen occasion and colour
12. bye - Exits the programme
____________________________________________________________
What can I do for you?
Enjoy your bouquet! Thank you for using Florizz
Expand Down

0 comments on commit efed9d0

Please sign in to comment.