can anyone help me to convert this pseudo to c#.
program projectx
String x;
Boolean f;
integer a,z,g;
x = readinput;
g = length of x;
z = g minus one;
a = zero
if g = 1 then
f = 1
else
f = 1;
while f=1 and a less than z
while character at a of x is one of
[whitespace,comma,semicolon, exclamation_mark, question_mark, or full stop] a++;
while character at z of x is one of
[whitespace,comma,semicolon, exclamation_mark, question_mark, or full stop] z--;
if the toUpperCase of character at a of x is identical to the toUpperCase of character at z of x then a++ and z--;
else f=0;
if f=0 then print out appropriate message
else
print out other appropriate message
What I have tried:
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
string x;
bool f;
int a, z, g;
x = Console.ReadLine();
g = x.Length;
z = g - 1;
a = 0;
if (g == 1)
f = true;
else
{
f = true;
while (f && a < z)
{
while (x,a = (" " "," ";" "!" "?" "."))
a++;
}
{
while (x[z] = (" " "," "," "!" "?" "."))
z--;
}
if toUpper(x[a]) == toupper(x[z]))
a++;
z--;
}
{
else
{
f = false;
}
{
if (!f)
Console.ReadLine "Palindrome";
else
Console.ReadLine "NotPalindrome";
}
}
}
}