From 7692525592907d507cac11cdcad9abf4192989b3 Mon Sep 17 00:00:00 2001 From: alxkm Date: Sun, 18 Aug 2024 15:56:54 +0200 Subject: [PATCH 1/8] refactor: OctalToDecimal --- .../conversions/OctalToDecimal.java | 55 +++++++++---------- .../conversions/OctalToDecimalTest.java | 19 +++++-- 2 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/main/java/com/thealgorithms/conversions/OctalToDecimal.java b/src/main/java/com/thealgorithms/conversions/OctalToDecimal.java index 187f0ed1e2ea..78a0fb9e3c58 100644 --- a/src/main/java/com/thealgorithms/conversions/OctalToDecimal.java +++ b/src/main/java/com/thealgorithms/conversions/OctalToDecimal.java @@ -1,47 +1,42 @@ package com.thealgorithms.conversions; -import java.util.Scanner; - /** - * Converts any Octal Number to a Decimal Number + * Class for converting an octal number to a decimal number. Octal numbers are based on 8, using digits from 0 to 7. * - * @author Zachary Jones */ public final class OctalToDecimal { + private static final int OCTAL_BASE = 8; + private OctalToDecimal() { } /** - * Main method + * Converts a given octal number (as a string) to its decimal representation. + * If the input is not a valid octal number (i.e., contains characters other than 0-7), + * the method throws an IllegalArgumentException. * - * @param args Command line arguments + * @param inputOctal The octal number as a string + * @return The decimal equivalent of the octal number + * @throws IllegalArgumentException if the input is not a valid octal number */ - public static void main(String[] args) { - Scanner sc = new Scanner(System.in); - System.out.print("Octal Input: "); - String inputOctal = sc.nextLine(); - int result = convertOctalToDecimal(inputOctal); - if (result != -1) { - System.out.println("Result convertOctalToDecimal : " + result); + public static int convertOctalToDecimal(String inputOctal) { + if (inputOctal == null || inputOctal.isEmpty()) { + throw new IllegalArgumentException("Input cannot be null or empty"); } - sc.close(); - } - /** - * This method converts an octal number to a decimal number. - * - * @param inputOctal The octal number - * @return The decimal number - */ - public static int convertOctalToDecimal(String inputOctal) { - try { - // Actual conversion of Octal to Decimal: - return Integer.parseInt(inputOctal, 8); - } catch (NumberFormatException ne) { - // Printing a warning message if the input is not a valid octal - // number: - System.out.println("Invalid Input, Expecting octal number 0-7"); - return -1; + int decimalValue = 0; + + for (int i = 0; i < inputOctal.length(); i++) { + char currentChar = inputOctal.charAt(i); + + if (currentChar < '0' || currentChar > '7') { + throw new IllegalArgumentException("Invalid input: Expecting an octal number (digits 0-7)"); + } + + int currentDigit = currentChar - '0'; + decimalValue = decimalValue * OCTAL_BASE + currentDigit; } + + return decimalValue; } } diff --git a/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java b/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java index 6e17ea14efc8..d70468372820 100644 --- a/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java +++ b/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java @@ -2,13 +2,22 @@ import static org.junit.jupiter.api.Assertions.assertEquals; -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; public class OctalToDecimalTest { - @Test - public void testOctalToDecimal() { - assertEquals(1465, OctalToDecimal.convertOctalToDecimal("2671")); - assertEquals(189, OctalToDecimal.convertOctalToDecimal("275")); + @ParameterizedTest + @CsvSource({"10, 8", "7, 7", "77, 63", "123, 83", "0, 0", "777, 511", "2671, 1465", "275, 189"}) + void testConvertOctalToDecimal(String inputOctal, int expectedDecimal) { + assertEquals(expectedDecimal, OctalToDecimal.convertOctalToDecimal(inputOctal)); + } + + @ParameterizedTest + @CsvSource({"'', Input cannot be null or empty", "'8', Invalid input: Expecting an octal number (digits 0-7)", "'19', Invalid input: Expecting an octal number (digits 0-7)"}) + void testConvertOctalToDecimal_InvalidInputs(String inputOctal, String expectedMessage) { + IllegalArgumentException exception = Assertions.assertThrows(IllegalArgumentException.class, () -> OctalToDecimal.convertOctalToDecimal(inputOctal)); + Assertions.assertEquals(expectedMessage, exception.getMessage()); } } From b69066f1e2f90d4afa92a35286af23253c9ab6a9 Mon Sep 17 00:00:00 2001 From: alxkm Date: Sun, 18 Aug 2024 16:03:39 +0200 Subject: [PATCH 2/8] checkstyle: fix naming --- .../conversions/OctalToHexadecimal.java | 77 +++++++++---------- .../conversions/OctalToHexadecimalTest.java | 26 +++++-- 2 files changed, 55 insertions(+), 48 deletions(-) diff --git a/src/main/java/com/thealgorithms/conversions/OctalToHexadecimal.java b/src/main/java/com/thealgorithms/conversions/OctalToHexadecimal.java index 5cc97fde12aa..d8f80d17851f 100644 --- a/src/main/java/com/thealgorithms/conversions/OctalToHexadecimal.java +++ b/src/main/java/com/thealgorithms/conversions/OctalToHexadecimal.java @@ -1,65 +1,60 @@ package com.thealgorithms.conversions; -import java.util.Scanner; - /** - * Converts any Octal Number to HexaDecimal + * Class for converting an Octal number to its Hexadecimal equivalent. * - * @author Tanmay Joshi */ public final class OctalToHexadecimal { + private static final int OCTAL_BASE = 8; + private static final int HEX_BASE = 16; + private static final String HEX_DIGITS = "0123456789ABCDEF"; + private OctalToHexadecimal() { } /** - * This method converts a Octal number to a decimal number + * Converts an Octal number (as a string) to its Decimal equivalent. * - * @param s The Octal Number - * @return The Decimal number + * @param octalNumber The Octal number as a string + * @return The Decimal equivalent of the Octal number + * @throws IllegalArgumentException if the input contains invalid octal digits */ - public static int octToDec(String s) { - int i = 0; - for (int j = 0; j < s.length(); j++) { - char num = s.charAt(j); - num -= '0'; - i *= 8; - i += num; + public static int octalToDecimal(String octalNumber) { + if (octalNumber == null || octalNumber.isEmpty()) { + throw new IllegalArgumentException("Input cannot be null or empty"); } - return i; + + int decimalValue = 0; + for (int i = 0; i < octalNumber.length(); i++) { + char currentChar = octalNumber.charAt(i); + if (currentChar < '0' || currentChar > '7') { + throw new IllegalArgumentException("Invalid octal digit: " + currentChar); + } + int currentDigit = currentChar - '0'; + decimalValue = decimalValue * OCTAL_BASE + currentDigit; + } + + return decimalValue; } /** - * This method converts a Decimal number to a Hexadecimal number + * Converts a Decimal number to its Hexadecimal equivalent. * - * @param d The Decimal Number - * @return The Hexadecimal number + * @param decimalNumber The Decimal number + * @return The Hexadecimal equivalent of the Decimal number */ - public static String decimalToHex(int d) { - String digits = "0123456789ABCDEF"; - if (d <= 0) { + public static String decimalToHexadecimal(int decimalNumber) { + if (decimalNumber == 0) { return "0"; } - String hex = ""; - while (d > 0) { - int digit = d % 16; - hex = digits.charAt(digit) + hex; - d = d / 16; - } - return hex; - } - public static void main(String[] args) { - Scanner input = new Scanner(System.in); - System.out.print("Enter the Octal number: "); - // Take octal number as input from user in a string - String oct = input.next(); - - // Pass the octal number to function and get converted decimal form - int decimal = octToDec(oct); + StringBuilder hexValue = new StringBuilder(); + while (decimalNumber > 0) { + int digit = decimalNumber % HEX_BASE; + hexValue.insert(0, HEX_DIGITS.charAt(digit)); + decimalNumber /= HEX_BASE; + } - // Pass the decimal number to function and get converted Hex form of the number - String hex = decimalToHex(decimal); - System.out.println("The Hexadecimal equivalant is: " + hex); - input.close(); + return hexValue.toString(); } } diff --git a/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java b/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java index f71732b27d51..88a6e7500afd 100644 --- a/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java +++ b/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java @@ -1,14 +1,26 @@ package com.thealgorithms.conversions; -import static org.junit.jupiter.api.Assertions.assertEquals; - -import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; public class OctalToHexadecimalTest { - @Test - public void testOctalToHexadecimal() { - assertEquals("1EA", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("752"))); - assertEquals("15E", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("536"))); + @ParameterizedTest + @CsvSource({"0, 0", "7, 7", "10, 8", "17, F", "20, 10", "777, 1FF", "1234, 29C", "752, 1EA", "536, 15E"}) + void testOctalToHexadecimal_ValidInputs(String inputOctal, String expectedHex) { + int decimal = OctalToHexadecimal.octalToDecimal(inputOctal); + String hex = OctalToHexadecimal.decimalToHexadecimal(decimal); + Assertions.assertEquals(expectedHex, hex); + } + + @ParameterizedTest + @CsvSource({"'', Input cannot be null or empty", "'8', Invalid octal digit: 8", "'19', Invalid octal digit: 9"}) + void testOctalToHexadecimal_InvalidInputs(String inputOctal, String expectedMessage) { + IllegalArgumentException exception = Assertions.assertThrows( + IllegalArgumentException.class, + () -> OctalToHexadecimal.octalToDecimal(inputOctal) + ); + Assertions.assertEquals(expectedMessage, exception.getMessage()); } } From de0eccc0bc625a70807cec58c07d6b2c5743a63f Mon Sep 17 00:00:00 2001 From: alxkm Date: Sun, 18 Aug 2024 16:06:16 +0200 Subject: [PATCH 3/8] fix: revert --- .../conversions/OctalToHexadecimal.java | 77 ++++++++++--------- .../conversions/OctalToHexadecimalTest.java | 26 ++----- 2 files changed, 48 insertions(+), 55 deletions(-) diff --git a/src/main/java/com/thealgorithms/conversions/OctalToHexadecimal.java b/src/main/java/com/thealgorithms/conversions/OctalToHexadecimal.java index d8f80d17851f..5cc97fde12aa 100644 --- a/src/main/java/com/thealgorithms/conversions/OctalToHexadecimal.java +++ b/src/main/java/com/thealgorithms/conversions/OctalToHexadecimal.java @@ -1,60 +1,65 @@ package com.thealgorithms.conversions; +import java.util.Scanner; + /** - * Class for converting an Octal number to its Hexadecimal equivalent. + * Converts any Octal Number to HexaDecimal * + * @author Tanmay Joshi */ public final class OctalToHexadecimal { - private static final int OCTAL_BASE = 8; - private static final int HEX_BASE = 16; - private static final String HEX_DIGITS = "0123456789ABCDEF"; - private OctalToHexadecimal() { } /** - * Converts an Octal number (as a string) to its Decimal equivalent. + * This method converts a Octal number to a decimal number * - * @param octalNumber The Octal number as a string - * @return The Decimal equivalent of the Octal number - * @throws IllegalArgumentException if the input contains invalid octal digits + * @param s The Octal Number + * @return The Decimal number */ - public static int octalToDecimal(String octalNumber) { - if (octalNumber == null || octalNumber.isEmpty()) { - throw new IllegalArgumentException("Input cannot be null or empty"); + public static int octToDec(String s) { + int i = 0; + for (int j = 0; j < s.length(); j++) { + char num = s.charAt(j); + num -= '0'; + i *= 8; + i += num; } - - int decimalValue = 0; - for (int i = 0; i < octalNumber.length(); i++) { - char currentChar = octalNumber.charAt(i); - if (currentChar < '0' || currentChar > '7') { - throw new IllegalArgumentException("Invalid octal digit: " + currentChar); - } - int currentDigit = currentChar - '0'; - decimalValue = decimalValue * OCTAL_BASE + currentDigit; - } - - return decimalValue; + return i; } /** - * Converts a Decimal number to its Hexadecimal equivalent. + * This method converts a Decimal number to a Hexadecimal number * - * @param decimalNumber The Decimal number - * @return The Hexadecimal equivalent of the Decimal number + * @param d The Decimal Number + * @return The Hexadecimal number */ - public static String decimalToHexadecimal(int decimalNumber) { - if (decimalNumber == 0) { + public static String decimalToHex(int d) { + String digits = "0123456789ABCDEF"; + if (d <= 0) { return "0"; } - - StringBuilder hexValue = new StringBuilder(); - while (decimalNumber > 0) { - int digit = decimalNumber % HEX_BASE; - hexValue.insert(0, HEX_DIGITS.charAt(digit)); - decimalNumber /= HEX_BASE; + String hex = ""; + while (d > 0) { + int digit = d % 16; + hex = digits.charAt(digit) + hex; + d = d / 16; } + return hex; + } + + public static void main(String[] args) { + Scanner input = new Scanner(System.in); + System.out.print("Enter the Octal number: "); + // Take octal number as input from user in a string + String oct = input.next(); + + // Pass the octal number to function and get converted decimal form + int decimal = octToDec(oct); - return hexValue.toString(); + // Pass the decimal number to function and get converted Hex form of the number + String hex = decimalToHex(decimal); + System.out.println("The Hexadecimal equivalant is: " + hex); + input.close(); } } diff --git a/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java b/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java index 88a6e7500afd..347f0eb86fb5 100644 --- a/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java +++ b/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java @@ -1,26 +1,14 @@ package com.thealgorithms.conversions; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; +import static org.junit.jupiter.api.Assertions.*; -public class OctalToHexadecimalTest { +import org.junit.jupiter.api.Test; - @ParameterizedTest - @CsvSource({"0, 0", "7, 7", "10, 8", "17, F", "20, 10", "777, 1FF", "1234, 29C", "752, 1EA", "536, 15E"}) - void testOctalToHexadecimal_ValidInputs(String inputOctal, String expectedHex) { - int decimal = OctalToHexadecimal.octalToDecimal(inputOctal); - String hex = OctalToHexadecimal.decimalToHexadecimal(decimal); - Assertions.assertEquals(expectedHex, hex); - } +public class OctalToHexadecimalTest { - @ParameterizedTest - @CsvSource({"'', Input cannot be null or empty", "'8', Invalid octal digit: 8", "'19', Invalid octal digit: 9"}) - void testOctalToHexadecimal_InvalidInputs(String inputOctal, String expectedMessage) { - IllegalArgumentException exception = Assertions.assertThrows( - IllegalArgumentException.class, - () -> OctalToHexadecimal.octalToDecimal(inputOctal) - ); - Assertions.assertEquals(expectedMessage, exception.getMessage()); + @Test + public void testOctalToHexadecimal() { + assertEquals("1EA", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("752"))); + assertEquals("15E", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("536"))); } } From c772d0218e66a3e6ae0f936c8b9f0dff6f6673fa Mon Sep 17 00:00:00 2001 From: alxkm Date: Sun, 18 Aug 2024 16:06:36 +0200 Subject: [PATCH 4/8] fix: checkstyle --- .../java/com/thealgorithms/conversions/OctalToDecimal.java | 2 +- .../com/thealgorithms/conversions/OctalToDecimalTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/thealgorithms/conversions/OctalToDecimal.java b/src/main/java/com/thealgorithms/conversions/OctalToDecimal.java index 78a0fb9e3c58..d91ce6eb3634 100644 --- a/src/main/java/com/thealgorithms/conversions/OctalToDecimal.java +++ b/src/main/java/com/thealgorithms/conversions/OctalToDecimal.java @@ -30,7 +30,7 @@ public static int convertOctalToDecimal(String inputOctal) { char currentChar = inputOctal.charAt(i); if (currentChar < '0' || currentChar > '7') { - throw new IllegalArgumentException("Invalid input: Expecting an octal number (digits 0-7)"); + throw new IllegalArgumentException("Incorrect input: Expecting an octal number (digits 0-7)"); } int currentDigit = currentChar - '0'; diff --git a/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java b/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java index d70468372820..addda502a828 100644 --- a/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java +++ b/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java @@ -15,8 +15,8 @@ void testConvertOctalToDecimal(String inputOctal, int expectedDecimal) { } @ParameterizedTest - @CsvSource({"'', Input cannot be null or empty", "'8', Invalid input: Expecting an octal number (digits 0-7)", "'19', Invalid input: Expecting an octal number (digits 0-7)"}) - void testConvertOctalToDecimal_InvalidInputs(String inputOctal, String expectedMessage) { + @CsvSource({"'', Input cannot be null or empty", "'8', Incorrect input: Expecting an octal number (digits 0-7)", "'19', Incorrect input: Expecting an octal number (digits 0-7)"}) + void testIncorrectInput(String inputOctal, String expectedMessage) { IllegalArgumentException exception = Assertions.assertThrows(IllegalArgumentException.class, () -> OctalToDecimal.convertOctalToDecimal(inputOctal)); Assertions.assertEquals(expectedMessage, exception.getMessage()); } From 15797b64c31f60079b90677432738c7c5ef7fe53 Mon Sep 17 00:00:00 2001 From: alxkm Date: Sun, 18 Aug 2024 16:10:27 +0200 Subject: [PATCH 5/8] fix: revert --- .../com/thealgorithms/conversions/OctalToHexadecimalTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java b/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java index 347f0eb86fb5..f71732b27d51 100644 --- a/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java +++ b/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java @@ -1,6 +1,6 @@ package com.thealgorithms.conversions; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; import org.junit.jupiter.api.Test; From 68fe694bcef4e3725fea828d918bb0c41ebed12a Mon Sep 17 00:00:00 2001 From: alxkm Date: Sun, 18 Aug 2024 16:22:54 +0200 Subject: [PATCH 6/8] fix: static import --- .../thealgorithms/conversions/OctalToHexadecimalTest.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java b/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java index f71732b27d51..c7f7c21dd1d8 100644 --- a/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java +++ b/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java @@ -1,14 +1,13 @@ package com.thealgorithms.conversions; -import static org.junit.jupiter.api.Assertions.assertEquals; - +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; public class OctalToHexadecimalTest { @Test public void testOctalToHexadecimal() { - assertEquals("1EA", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("752"))); - assertEquals("15E", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("536"))); + Assertions.assertEquals("1EA", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("752"))); + Assertions.assertEquals("15E", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("536"))); } } From d08b514a104d19ca0c18a24d49cc988557b86a21 Mon Sep 17 00:00:00 2001 From: alxkm Date: Sun, 18 Aug 2024 16:27:21 +0200 Subject: [PATCH 7/8] checkstyle: fix pmd static import --- .../thealgorithms/conversions/OctalToHexadecimalTest.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java b/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java index c7f7c21dd1d8..f71732b27d51 100644 --- a/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java +++ b/src/test/java/com/thealgorithms/conversions/OctalToHexadecimalTest.java @@ -1,13 +1,14 @@ package com.thealgorithms.conversions; -import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; + import org.junit.jupiter.api.Test; public class OctalToHexadecimalTest { @Test public void testOctalToHexadecimal() { - Assertions.assertEquals("1EA", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("752"))); - Assertions.assertEquals("15E", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("536"))); + assertEquals("1EA", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("752"))); + assertEquals("15E", OctalToHexadecimal.decimalToHex(OctalToHexadecimal.octToDec("536"))); } } From 59018b9c2b9373641b5aa1ae154d991b13a248c1 Mon Sep 17 00:00:00 2001 From: Andrii Siriak Date: Sun, 18 Aug 2024 21:41:19 +0300 Subject: [PATCH 8/8] Update OctalToDecimalTest.java --- .../com/thealgorithms/conversions/OctalToDecimalTest.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java b/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java index addda502a828..20f0fa40c626 100644 --- a/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java +++ b/src/test/java/com/thealgorithms/conversions/OctalToDecimalTest.java @@ -1,7 +1,5 @@ package com.thealgorithms.conversions; -import static org.junit.jupiter.api.Assertions.assertEquals; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.CsvSource; @@ -11,7 +9,7 @@ public class OctalToDecimalTest { @ParameterizedTest @CsvSource({"10, 8", "7, 7", "77, 63", "123, 83", "0, 0", "777, 511", "2671, 1465", "275, 189"}) void testConvertOctalToDecimal(String inputOctal, int expectedDecimal) { - assertEquals(expectedDecimal, OctalToDecimal.convertOctalToDecimal(inputOctal)); + Assertions.assertEquals(expectedDecimal, OctalToDecimal.convertOctalToDecimal(inputOctal)); } @ParameterizedTest