Question

In: Computer Science

I need the c# code for the below assignment. Complete PigLatin program in Windows Forms GUI....

I need the c# code for the below assignment.

Complete PigLatin program in Windows Forms GUI. Zip the solution project file and attach to this submission. Do this in the GUI format (Windows Form). Be sure and add a Clear Button to reset for entering another word or words.

PigLatinGUI

Basic Steps in Creating your Program

  1. Create your user interface (GUI). Use different font styles but don’t overdo it, Use colors, and Use graphics (You can find all kinds of graphics for the images pizzas). Add the controls you will use for your program. You could use picture boxes, buttons, labels, combo box, radio buttons, option box and any other controls that might help in the presentation of GUI. The book has an example of what the GUI could look like, but be creative and make your own GUI.
  2. Set the names of all controls. (for example, if you have a list box or label it could be txtNumber). Follow the naming convention (camel casing) for naming controls.
  3. Now you are ready to write the code that will be executed by events at run time. You will probably have a button or other picture box control that you will click on at runtime. Double Click it and you will be taken to the code window where you can write code inside of the control code event handler.
  4. Run and debug your program, making sure all parts work correctly. Consider data validation for the input information. As you advance to more complicated programs you will be given various ideas on validating input.
  5. Remember to document your code with comments included in your code statements in the code window.

Your program assignment

Pig Latin is a nonsense language. To create a word in pig Latin, you remove the first letter and then add the first letter and “ay” at the end of the ford. For example, “dog” becomes “ogday” and “cat” becomes “atcay”. Write a program named PigLatin that allows the user to enter a word and display’s the pig Latin version.

For words which begin with vowel sounds or silent letter, one just adds "yay" to the end. Examples are:

  • "eat" → "eatyay"
  • "omelet" → "omeletyay"
  • "are" → "areyay"

Another less common way some speakers may use a different ending for words starting with vowels is adding "way" (or "wa") to the end. Examples are:

  • "egg" → "eggway"
  • "inbox" → "inboxway"
  • "eight" → "eightway"

You could use the split command to enter more than one word. Indicating delimiters

char[] delimiterChars = { ' ', ',', '.', ':', ';', '\t' };

string[] words = text.Split(delimiterChars);

Solutions

Expert Solution

Below is the solution:

code:

using System;
using System.Windows.Forms;

namespace PigLatinConvert
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnConvert_Click(object sender, EventArgs e)
        {
            {
                string eng = Convert.ToString(txtWord.Text); //entered text is store in english variable
                string pl = ""; //set tle pl string variable to blank/null
                string fl; //declare the fl variable for first letter of the given word take
                string restWord; //take the fl variable for remaining letter not included the first letter
                string vowels = "AEIOUaeiou"; //vowel string
                int lp; //variable lp for letter position
                //char[] delimiterChars = { ' ', ',', '.', ':', ';', '\t' };
                //string[] words = eng.Split(delimiterChars);
                foreach (string word in eng.Split())
                {
                    fl = word.Substring(0, 1); //take the first letter of input word
                    restWord = word.Substring(1, word.Length - 1); // take the remaing letter not included first letter
                    lp = vowels.IndexOf(fl);
                    if (lp == -1)
                    {
                        //it's a consonant
                      
                        pl = eng +" of Pig Latin word is: "+restWord + fl + "yay";
                    }
                    else
                    {
                        //it's a vowel
                        pl = eng + " of Pig Latin word is: " +word + "way";
                    }
                    lblPigLatin.Text = pl .ToString(); //display the letter in lblPigLatin label
                    txtWord.Focus();
                }
            }
        }
    }
}

sample output:


Related Solutions

I need to complete this C++ program. The instructions are in the comments inside the code...
I need to complete this C++ program. The instructions are in the comments inside the code below: ------------------------------------------------------------------------- Original string is: this is a secret! Encypted string is: uijt!jt!b!tfdsfu" Decrypted string is: this is a secret! //Encoding program //Pre-_____? //other necessary stuff here int main() { //create a string to encrypt using a char array cout<< "Original string is: "<<string<<endl; encrypt(string); cout<< "Encrypted string is: "<<string<<endl; decrypt(string); cout<<"Decrypted string is: "<<string<<endl; return 0; } void encrypt(char e[]) { //Write implementation...
***IN C# ONLY, USING WINDOWS FORMS*** --NO JAVA--. Create a GUI application in C# that calculates...
***IN C# ONLY, USING WINDOWS FORMS*** --NO JAVA--. Create a GUI application in C# that calculates and displays the total travel expenses of a business person on a trip. Here is the information that the user must provide: • Number of days on the trip • Amount of airfare, if any • Amount of car rental fees, if any • Number of miles driven, if a private vehicle was used • Amount of parking fees, if any • Amount of...
I need a full java code. And I need it in GUI With the mathematics you...
I need a full java code. And I need it in GUI With the mathematics you have studied so far in your education you have worked with polynomials. Polynomials are used to describe curves of various types; people use them in the real world to graph curves. For example, roller coaster designers may use polynomials to describe the curves in their rides. Polynomials appear in many areas of mathematics and science. Write a program which finds an approximate solution to...
Using C# Windows App Form Create a simple calculator using +,-,*,/ Please show code GUI Code...
Using C# Windows App Form Create a simple calculator using +,-,*,/ Please show code GUI Code for calculator menus radio button input text boxes
I have to code the assignment below. I cannot get the program to work and I...
I have to code the assignment below. I cannot get the program to work and I am not sure what i am missing to get the code to work past the input of the two numbers from the user. My code is listed under the assignment details. Please help! Write a Java program that displays the prime numbers between A and B. Inputs: Prompt the user for the values A and B, which should be integers with B greater than...
This problem needs to be solved with source code. I need a C++ program that will...
This problem needs to be solved with source code. I need a C++ program that will help me solve this question. I need it in C++, please. Writing with comments so it maybe cleared. 1.2. We received the following ciphertext which was encoded with a shift cipher: xultpaajcxitltlxaarpjhtiwtgxktghidhipxciwtvgtpilpit ghlxiwiwtxgqadds. 1. Perform an attack against the cipher based on a letter frequency count: How many letters do you have to identify through a frequency count to recover the key? What is...
I need specific codes for this C program assignment. Thank you! C program question: Write a...
I need specific codes for this C program assignment. Thank you! C program question: Write a small C program connect.c that: 1. Initializes an array id of N elements with the value of the index of the array. 2. Reads from the keyboard or the command line a set of two integer numbers (p and q) until it encounters EOF or CTL - D 3. Given the two numbers, your program should connect them by going through the array and...
I need an original matlab code and gui for a simple double pendulum. This needs to...
I need an original matlab code and gui for a simple double pendulum. This needs to be original and not too complicated. Please provide basic instructions. Thank you!
I need the code for a C++ program that creates an array of 5000 String objects...
I need the code for a C++ program that creates an array of 5000 String objects that will store each word from a text file. The program will read in each word from a file, and store the first 5000 words in the array. The text file should be read in from the command line.
modify the code below to create a GUI program that accepts a String from the user...
modify the code below to create a GUI program that accepts a String from the user in a TextField and reports whether or not there are repeated characters in it. Thus your program is a client of the class which you created in question 1 above. N.B. most of the modification needs to occur in the constructor and the actionPerformed() methods. So you should spend time working out exactly what these two methods are doing, so that you can make...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT