Hi everyone!
I am new to C# as well as coding and currently I am trying to challenge myself trying to create a console application that encodes and decodes "Caeser Shift".
Here is my code:
static void Main(string[] args)
{
char[] letters = new char[26] {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; // array of alphabets
string text = Console.ReadLine(); // text input
double shiftnumber;
shiftnumber = Convert.ToDouble(Console.ReadLine()); // the number of times to shift
for (int i = 0; i < text.Length; i++)
{
// This is just where I stuck
}
As you see I am able to separate all the letters of an input text and if I put "Console.WriteLine(text);" and write hello it gives me:
h
e
l
l
o
From this point, what I really want is to use the array containing alphabets to shift my text. I'd really appreciate for help
I am new to C# as well as coding and currently I am trying to challenge myself trying to create a console application that encodes and decodes "Caeser Shift".
Here is my code:
static void Main(string[] args)
{
char[] letters = new char[26] {'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'}; // array of alphabets
string text = Console.ReadLine(); // text input
double shiftnumber;
shiftnumber = Convert.ToDouble(Console.ReadLine()); // the number of times to shift
for (int i = 0; i < text.Length; i++)
{
// This is just where I stuck
}
As you see I am able to separate all the letters of an input text and if I put "Console.WriteLine(text);" and write hello it gives me:
h
e
l
l
o
From this point, what I really want is to use the array containing alphabets to shift my text. I'd really appreciate for help