From 772f952ea3649d2785641751d04c170f87e56055 Mon Sep 17 00:00:00 2001 From: Sage The DM Date: Mon, 13 Jan 2025 21:26:26 +0100 Subject: [PATCH] Finalized the project --- .../_javafx_website_task/cart.txt | 6 ++++ .../main/java/com/example/ShopController.java | 30 +++++++++++------- .../classes/com/example/ShopController.class | Bin 4358 -> 6033 bytes 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/cart.txt b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/cart.txt index e69de29..00e9841 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/cart.txt +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/cart.txt @@ -0,0 +1,6 @@ +Lord of the Rings +Lord of the Rings +Lord of the Rings +Lord of the Rings +The Wheel of Time +The Wheel of Time diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/ShopController.java b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/ShopController.java index 5e61ac0..da7207c 100644 --- a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/ShopController.java +++ b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/src/main/java/com/example/ShopController.java @@ -57,49 +57,57 @@ public class ShopController { // Book Addition Handlers @FXML private void handleAddToCartButton1(ActionEvent event) { - addToCart("Lord of the Rings"); + addToCart("Lord of the Rings", + "A high-fantasy epic by J.R.R. Tolkien. The story follows the journey of Frodo Baggins and his companions as they attempt to destroy the One Ring and defeat the Dark Lord Sauron."); } @FXML private void handleAddToCartButton2(ActionEvent event) { - addToCart("The Wheel of Time"); + addToCart("The Wheel of Time", + "A sprawling epic fantasy series by Robert Jordan. It follows the journey of Rand al'Thor as he struggles to control his newfound powers and faces the ultimate battle between light and shadow."); } @FXML private void handleAddToCartButton3(ActionEvent event) { - addToCart("The Chronicles of Narnia"); + addToCart("The Chronicles of Narnia", + "A beloved fantasy series by C.S. Lewis. It tells the magical adventures of children in the land of Narnia, filled with mythical creatures, epic battles, and profound allegorical themes."); } @FXML private void handleAddToCartButton4(ActionEvent event) { - addToCart("The Earthsea Cycle"); + addToCart("The Earthsea Cycle", + "A fantasy series by Ursula K. Le Guin. It explores the coming-of-age journey of Ged, a young wizard, as he navigates the balance of power, magic, and morality."); } @FXML private void handleAddToCartButton5(ActionEvent event) { - addToCart("The First Law Trilogy"); + addToCart("The First Law Trilogy", + "A grimdark fantasy series by Joe Abercrombie. It features morally complex characters, brutal realism, and intertwining stories of politics, war, and betrayal."); } @FXML private void handleAddToCartButton6(ActionEvent event) { - addToCart("The Kingkiller Chronicle"); + addToCart("The Kingkiller Chronicle", + "An epic fantasy series by Patrick Rothfuss. It recounts the life of Kvothe, a gifted musician and magician, as he seeks revenge and unravels mysteries in a richly imagined world."); } @FXML private void handleAddToCartButton7(ActionEvent event) { - addToCart("The Mistborn Series"); + addToCart("The Mistborn Series", + "A unique fantasy series by Brandon Sanderson. It combines a rich magic system based on metals with a story of rebellion, heroism, and unexpected twists."); } @FXML private void handleAddToCartButton8(ActionEvent event) { - addToCart("The Stormlight Archive"); + addToCart("The Stormlight Archive", + "A grand fantasy epic by Brandon Sanderson. It weaves together multiple characters' stories in a richly detailed world of war, magic, and ancient secrets."); } - private void addToCart(String bookTitle) { + private void addToCart(String bookTitle, String bookDescription) { try (BufferedWriter writer = new BufferedWriter(new FileWriter(CART_FILE, true))) { - writer.write(bookTitle); + writer.write(bookTitle + " - " + bookDescription); writer.newLine(); - System.out.println("Added to cart: " + bookTitle); + System.out.println("Added to cart: " + bookTitle + " with description: " + bookDescription); } catch (IOException e) { System.err.println("Failed to add item to cart: " + e.getMessage()); } diff --git a/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/ShopController.class b/Code/ost/JAVA-FX-PROJECT/_javafx_website_task/target/classes/com/example/ShopController.class index ade332ba05849a26393b55218a76e2a41206b91e..0547cf175f8187695e41e096cc70e61010f2d281 100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