From fb27c2e246e2324800724ca1f170f4a5ce14ccd5 Mon Sep 17 00:00:00 2001 From: Alper Date: Fri, 30 Jan 2026 21:44:34 +0300 Subject: [PATCH] Fixed the errors Decoded and fixed the errors and methods. --- Cipher.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Cipher.java b/Cipher.java index 7527c5b..d3f3a73 100644 --- a/Cipher.java +++ b/Cipher.java @@ -15,7 +15,7 @@ public String encrypt(String inputString) { // for all chars in the input string for (int i = 0; i < inputString.length(); i++) { - + outputString += replaceChar(inputString.charAt(i), true); } return outputString; @@ -25,6 +25,11 @@ public String decrypt(String inputString) { // output string will be collected in this variable, one char at a time String outputString = ""; + + for (int i = 0; i < inputString.length(); i++) + { + outputString += replaceChar(inputString.charAt(i), false); + } replaceChar('a',true); @@ -58,4 +63,5 @@ private char replaceChar(char inputChar, boolean isEncrypt) { // if we did not find it in the alphabet, then return the original char return inputChar; } -} \ No newline at end of file + +}