I need help with creating a GUI program named PIG LATIN GUI that allows the user to enter a word and displays the pig Latin version.

How can i write a program that translates English word into pig Latin in visual studio?
Heather JacobsAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MishaProgrammerCommented:
At the first, you should decide, what type of program do you want to create. For example, it may be console application with user input (user input some text, press enter key and your program write new text in console). Therefore you select corresponding template when you start to write your program (Console Appication). Or you can select Windows Forms or other more difficult templates (user select file, where your english text is located and program create new file whith new text in pig Latin).

As regards algoritm, if you deicde to use Windows Forms, you can use this example:
namespace Pig_Latin_Translator
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
    List<string> vowels = new List<string>();
    List<string> specials = new List<string>();

    private void TranslateButton_Click(object sender, EventArgs e)
{
   char[] specials = "`1234567890-=[]\";',./~!@#$%^&*()_+{}|:\\<>?".ToArray();
    char[] vowels = "aeiou".ToArray();

    TranslateOutput.Text = String.Empty;

    if( TranslateBox.Text.IndexOfAny( specials ) > -1 ) {
        MessageBox.Show( "No Special Characters!", "Warning!", MessageBoxButtons.OK, MessageBoxIcon.Warning );
        return;
    }

    String[] parts = TranslateBox.Text.Split();
    foreach( String part in parts ) {
        int firstVowel = part.IndexOfAny( vowels );
        if( firstVowel > 0 ) {
            TranslateOutput.Text += part.Substring( firstVowel ) + part.Substring( 0, firstVowel ) + "ay ";
        }
        else {
            TranslateOutput.Text += part + "ay ";
        }
    }

    TranslateOutput.Text = TranslateOutput.Text.TrimEnd();
}

    private void Form1_Load(object sender, EventArgs e)
    {
	vowels.AddRange("aeiou".Select(x => x.ToString()));
	specials.AddRange(@"`1234567890-=[]\;',./~!@#$%^&*()_+{}|:""<>?".Select(x => x.ToString()));
    }

    private void AboutButton_Click(object sender, EventArgs e)
    {
        MessageBox.Show("Pig Latin is a fake language. It works by taking the first letter (Or two if it's a pair like 'th' or 'ch') and bringing it to the end, unless the first letter is a vowel. Then add 'ay' to the end. So 'bus' becomes 'usbay', 'thank' becomes 'ankthay' and 'apple' becomes 'appleay'.", "About:", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
}

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MishaProgrammerCommented:
There is no activity from author
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Visual Studio

From novice to tech pro — start learning today.