using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace pigLatin
{
class PigLatin
{
static void Main(string[] args)
{
string english = Convert.ToString("txtEnglsih.Text");
string Vowels = "AEIOUaeiou";
string firstLetter=null;
string restOftheWord;
string piglatin;
Console.WriteLine("");
foreach (char word in english)
{
char c = word;
english = firstLetter.Remove(c);
restOftheWord = firstLetter + "ay";
//ifconsent
if (firstLetter != Vowels)
{
piglatin = restOftheWord + firstLetter + "AY";
}
else
{
piglatin = word + "AY";
}
Console.ReadLine();
}
}
}
}
One error is bugging me, now in the text file I wrote down the word "Cat" to read it in a piglatin, it went throw with the program and one error pop up on the line 29 that says unassigned local variable"firstLetter...so I assigned it with Null...then when I started debugging a yellow line was marked on line 29 and there is a small bar pop up on the side that says Null Exception was unhanded
any help would be great
Thanks a lot

New Topic/Question
Reply




MultiQuote




|