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