Hello, I’m working on this task:
We like ciphers at the resistance base. For internal communication, we use a substitutional cipher. The idea is very simple: every letter in the incoming message is substituted with a different symbol. Your task is to partially encode a string message given to your program as an input and output the encoded message. Leave all letters except for the following:
- F and f: replace with !
- G and g: replace with @
- T and t: replace with #
- H and h: replace with $
- Y and y: replace with %
- B and b: replace with ^
For Example:
>After seeinG my dark Future, I can’t continue living in the Boring past.
A!#er seein@ m% dark !u#ure, I can’# con#inue livin@ in #$e ^orin@ pas#.
Here is my code:
namespace SwitchStatement
{
class SubstitutionCipher
{
static void Main()
{
string input = Console.ReadLine();
input = input.ToLower();
for(int i = 0; i < input.Length; i++)
{
switch (input[i])
{
case "f":
input[i] = "!";
break;
case "g":
input[i] = "@";
break;
case "t":
input[i] = "#";
break;
case "h":
input[i] = "$";
break;
case "y":
input[i] = "%";
break;
case "b":
input[i] = "^";
break;
default:
break;
}
}
}
}
}
Can anyone please help me to solve it?