I am trying to ulter the the text with charaters defined in the switch BUT I want to leave spaces capital letters and puntuations unchanged. I have succeeded with teh space but I can't get it to leave punctuations and capital letters unchanged.

Please help!!



int main(void)
{
const char text[]="Hello, it is me, how are you. This is a test and only a tes bye!";

char newtext[sizeof(plaintext)];

int i;
char ch;

i=0;
newtext[i]= '\0';

while ((ch=text[i++])!='\0')
{

if(ch>='a' && ch<='z')
{
switch (ch)
{
case 'a': strcat(newtext, "l"); break;
case 'b': strcat(newtext, "j"); break;
case 'c': strcat(newtext, "g"); break;
case 'd': strcat(newtext, "w"); break;
default: strcat(newtext, "Invalid"); break;
}
}
else
if (isspace(ch))
strcat (newtext," ");

if (isupper(ch)) ch=toupper(ch);

}
printf("%s\n",encrypttext);

return 0;
}