Solution not accepted in Encode the message

Here is my solution for the task, however system does not accept it:

/********************************/
using System;

namespace SwitchStatement

{

class SubstitutionCipher

{

    static void Main()

    {

        string inputMessage = Console.ReadLine();

        char[] inputMessageCipher = new char[inputMessage.Length];

        char[] inputMessageCipherLower = new char[inputMessage.Length];

        for(int i=0; i<inputMessage.Length; i++){

            inputMessageCipher[i] = inputMessage[i];

        }

        for(int i=0; i<inputMessageCipher.Length; i++){

            inputMessageCipherLower[i] = char.ToLower(inputMessage[i]);

        }

        for(int i=0; i<inputMessageCipher.Length; i++){

            switch (inputMessageCipherLower[i]){

            case 'f':

                inputMessageCipher[i] = '!';

                break;

            case 'g':

                inputMessageCipher[i] = '@';

                break;

            case 't':

                inputMessageCipher[i] = '#';

                break;

           

            case 'h':

                inputMessageCipher[i] = '@';

                break;

            case 'y':

                inputMessageCipher[i] = '%';

                break;

            case 'b':

                inputMessageCipher[i] = '^';

                break;

            default:

                break;

            }

        }

        Console.WriteLine(inputMessageCipher);

    }

}

}
/********************************/

Can you see any errors?

thanks a lot

Hi Kami, welcome to Codeasy forum!

I’ve checked your solution and it is almost correct. You have the wrong symbol for the letter ‘h’. It should be ‘$’ but you have ‘@’.

Hello!

A silly mistake by me. Thanks a lot for the help!

KB

1 Like