From 7ba888b63ec6335d515e845e6520a5d64c9f626a Mon Sep 17 00:00:00 2001 From: Kshitij Date: Wed, 6 Nov 2024 15:06:11 +0530 Subject: [PATCH] Fixed output for switch case and indentation. --- Codes/Group A/Assignment-A3/A3.java | 32 ++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Codes/Group A/Assignment-A3/A3.java b/Codes/Group A/Assignment-A3/A3.java index 963a1f4..16a3ed2 100644 --- a/Codes/Group A/Assignment-A3/A3.java +++ b/Codes/Group A/Assignment-A3/A3.java @@ -44,23 +44,23 @@ class A3 { switch (choice) { case 1: - new A3().add(a, b); + System.out.println("Result: " + new A3().add(a, b)); break; - case 2: - new A3().sub(a, b); - break; - case 3: - new A3().mul(a, b); - break; - case 4: - new A3().div(a, b); - break; - case 5: - System.out.println("## END OF CODE"); - System.exit(0); - default: - System.out.println("Please choose a valid option."); - break; + case 2: + System.out.println("Result: " + new A3().sub(a, b)); + break; + case 3: + System.out.println("Result: " + new A3().mul(a, b)); + break; + case 4: + System.out.println("Result: " + new A3().div(a, b)); + break; + case 5: + System.out.println("## END OF CODE"); + System.exit(0); + default: + System.out.println("Please choose a valid option."); + break; } } }