From 518a22f5875a38e404ca2fd25e6a3db032eb8a33 Mon Sep 17 00:00:00 2001 From: Fernando K L S D Date: Tue, 16 Jun 2026 15:00:50 +0530 Subject: [PATCH 1/5] Didnt used function called isValidChoice removed --- OOP Mini Project/.idea/vcs.xml | 6 ++++++ OOP Mini Project/src/ConsumerFactory.java | 4 ++-- OOP Mini Project/src/ElecBillCalculator.java | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 OOP Mini Project/.idea/vcs.xml diff --git a/OOP Mini Project/.idea/vcs.xml b/OOP Mini Project/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/OOP Mini Project/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/OOP Mini Project/src/ConsumerFactory.java b/OOP Mini Project/src/ConsumerFactory.java index f8f5781..33b67e0 100644 --- a/OOP Mini Project/src/ConsumerFactory.java +++ b/OOP Mini Project/src/ConsumerFactory.java @@ -12,12 +12,12 @@ public static Consumer createConsumer(int choice, String id, String name, do return null; } - public static boolean isValidChoice(int choice, String source) { + public static boolean isValidChoice(int choice) { return choice == 1 || choice == 2; } } -class consumer_type_helper { +class consumerTypeHelper { static String getLabel(int choice) { if (choice == 1) return "Standard Domestic"; return "Time-of-Use (TOU)"; diff --git a/OOP Mini Project/src/ElecBillCalculator.java b/OOP Mini Project/src/ElecBillCalculator.java index ed655f0..edfb289 100644 --- a/OOP Mini Project/src/ElecBillCalculator.java +++ b/OOP Mini Project/src/ElecBillCalculator.java @@ -26,7 +26,7 @@ public static void main(String[] args) { System.out.print("Choice: "); int choice = scanner.nextInt(); - if (!ConsumerFactory.isValidChoice(choice, "menu")) { + if (!ConsumerFactory.isValidChoice(choice)) { System.out.println("Invalid choice. Exiting."); scanner.close(); System.exit(0); From f316618748f95199c3606281f2f624ad86eee680 Mon Sep 17 00:00:00 2001 From: Fernando K L S D Date: Tue, 16 Jun 2026 15:48:07 +0530 Subject: [PATCH 2/5] Resolve unused method parameters in ConsumerFactory --- OOP Mini Project/src/ConsumerFactory.java | 3 +-- OOP Mini Project/src/ElecBillCalculator.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/OOP Mini Project/src/ConsumerFactory.java b/OOP Mini Project/src/ConsumerFactory.java index 33b67e0..bc4820e 100644 --- a/OOP Mini Project/src/ConsumerFactory.java +++ b/OOP Mini Project/src/ConsumerFactory.java @@ -2,8 +2,7 @@ public class ConsumerFactory { public static Consumer createConsumer(int choice, String id, String name, double solar, double totalUsage, double dayUsage, - double peakUsage, double offPeakUsage, - String planName, String tariffCode) { + double peakUsage, double offPeakUsage) { if (choice == 1) { return new StandardConsumer(id, name, solar, totalUsage); } else if (choice == 2) { diff --git a/OOP Mini Project/src/ElecBillCalculator.java b/OOP Mini Project/src/ElecBillCalculator.java index edfb289..73dd929 100644 --- a/OOP Mini Project/src/ElecBillCalculator.java +++ b/OOP Mini Project/src/ElecBillCalculator.java @@ -48,7 +48,7 @@ public static void main(String[] args) { } consumer = ConsumerFactory.createConsumer(choice, id, name, solar, - total, day, peak, off, "domestic", "PUCSL-2025"); + total, day, peak, off); BillRecord record = engine.createBillRecord(consumer, rates); engine.printBill(record, rates); From 6b8899b16a17dd9c5fbfb4778910ae9a0673e423 Mon Sep 17 00:00:00 2001 From: Fernando K L S D Date: Tue, 16 Jun 2026 16:25:19 +0530 Subject: [PATCH 3/5] Removed unessasary parameter called E --- OOP Mini Project/src/ConsumerFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OOP Mini Project/src/ConsumerFactory.java b/OOP Mini Project/src/ConsumerFactory.java index bc4820e..caf42c5 100644 --- a/OOP Mini Project/src/ConsumerFactory.java +++ b/OOP Mini Project/src/ConsumerFactory.java @@ -1,6 +1,6 @@ public class ConsumerFactory { - public static Consumer createConsumer(int choice, String id, String name, double solar, + public static Consumer createConsumer(int choice, String id, String name, double solar, double totalUsage, double dayUsage, double peakUsage, double offPeakUsage) { if (choice == 1) { From 989d97de8f22d7d21c6ed2d9afbf2136a3f6d4fa Mon Sep 17 00:00:00 2001 From: Fernando K L S D Date: Tue, 16 Jun 2026 16:33:51 +0530 Subject: [PATCH 4/5] Rename ConsumerTypeHelper class with proper naming convention --- OOP Mini Project/src/ConsumerFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OOP Mini Project/src/ConsumerFactory.java b/OOP Mini Project/src/ConsumerFactory.java index caf42c5..d207774 100644 --- a/OOP Mini Project/src/ConsumerFactory.java +++ b/OOP Mini Project/src/ConsumerFactory.java @@ -16,7 +16,7 @@ public static boolean isValidChoice(int choice) { } } -class consumerTypeHelper { +class ConsumerTypeHelper { static String getLabel(int choice) { if (choice == 1) return "Standard Domestic"; return "Time-of-Use (TOU)"; From 4add1a9b5be93907e81c0a96d9bf888ded31e0ea Mon Sep 17 00:00:00 2001 From: Fernando K L S D Date: Tue, 16 Jun 2026 16:40:56 +0530 Subject: [PATCH 5/5] Removed not unesasary import from TraffRate --- OOP Mini Project/src/TariffRate.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/OOP Mini Project/src/TariffRate.java b/OOP Mini Project/src/TariffRate.java index e3b9612..b219dbe 100644 --- a/OOP Mini Project/src/TariffRate.java +++ b/OOP Mini Project/src/TariffRate.java @@ -1,5 +1,3 @@ -import java.util.List; - public class TariffRate { private final double domesticSlab1Rate = 4.50; private final double domesticSlab2Rate = 8.00;