1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vovangra [49]
4 years ago
14

Write a program in C# : Pig Latin is a nonsense language. To create a word in pig Latin, you remove the first letter and then ad

d the first letter and "ay" at the end of the word. For example, "dog" becomes "ogday" and "cat" becomes "atcay". Write a GUI program named PigLatinGUI that allows the user to enter a word and displays the pig Latin version.

Computers and Technology
1 answer:
ludmilkaskok [199]4 years ago
7 0

Answer:

The csharp program is as follows.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;  

namespace WindowsFormsApplication1

{

   public partial class Form1 : Form

   {

       public Form1()

       {

           InitializeComponent();

       }

private void button1_Click(object sender, EventArgs e)

       {

           string word = textBox1.Text;

               string  ch = word.Substring(0, 1);

               string str = word.Substring(1, word.Length-1);

               string s = str.Insert(str.Length, ch);

               textBox2.Text = s.Insert(s.Length, "ay");            

       }

     private void button3_Click(object sender, EventArgs e)

       {

           Close();

       }

       private void button2_Click(object sender, EventArgs e)

       {

           textBox1.Text = "";

           textBox2.Text = "";

       }

   }

}

Explanation:

1. A string variable to hold the user input is declared and initialized accordingly. The user inputted string is taken from textbox1.

string word = textBox1.Text;

2. A string variable to hold the first character of the user inputted string is declared and initialized.

string  ch = word.Substring(0, 1);

3. A string variable to hold the user inputted string without the first character is declared and initialized accordingly.

string str = word.Substring(1, word.Length-1);

4. A string variable to hold the substring from step 3 along with the inserted characters at the end, is declared and initialized accordingly.

string s = str.Insert(str.Length, ch);

5. The final string is assigned to the textbox 2, which is the PigLatin conversion of the user inputted string.

textBox2.Text = s.Insert(s.Length, "ay");

6. All the above take place when the user clicks Convert to PigLatin button.

7. Two additional buttons, clear and exit are also included in the form.  

8. When the user clicks clear button, both the textboxes are initialized to empty string thus clearing both the textboxes.

 textBox1.Text = "";

           textBox2.Text = "";

9. When the user clicks the exit button, the application closes using the Close() method.

10. The program is done in Visual Studio.

11. The output of the program is attached.

12. The program can be tested for any type of string and any length of the string.

You might be interested in
NO LINKS OR SPAMS THEY WILL BE REPORTD<br><br> Click here for 50 points
storchak [24]

Answer:

I clicked bro

Explanation:

What now?

7 0
3 years ago
Read 2 more answers
When you put points on a question does it take away from your own?
KiRa [710]

Answer:

Yup

Explanation:

Just answer questions for more points

5 0
3 years ago
Read 2 more answers
Pls help... : Slide layouts can be changed by _____.
Eddi Din [679]

Answer:

Selecting a new layout from the task pane

Explanation:

6 0
3 years ago
You can use a server-side script as a ____ to access data from another domain.
Mashcka [7]
I believe the answer your looking for is "Proxy"
0 0
4 years ago
Alice's public key, and sends back the number R encrypted with his private key. Alice decrypts the message and verifies that the
Agata [3.3K]

There are different kinds of keys. The identities of Alice and Bob are verified in this protocol.

<h3>What is public and private key in SSL?</h3>

These keys are known to be a kind of related pair of text files and they are often made together as a pair if one makes their Certificate Signing Request (CSR).

Note that the private key is different file that is often used in the encryption/decryption of data so as to sent a file between one's server and the connecting clients.

Learn more about  public/private key from

brainly.com/question/8782374

3 0
2 years ago
Other questions:
  • Consider the following JavaScript program:
    8·1 answer
  • I am having trouble with logic gates(AND NOR,etc)
    8·2 answers
  • 18. Which type of briefing is delivered to individual resources or crews who are assigned to operational tasks and/or work at or
    14·1 answer
  • You are using a PowerPoint template from your school to present your research findings in front of the class. What would you do,
    13·2 answers
  • The Presonus Studio Live 24 console has analog D-sub direct outputs. What cable would you need to connect this to a HD Analog in
    15·2 answers
  • Which function will show 6 as the answer in the following formula<br><br> =_ (36)
    10·1 answer
  • You often travel away from the office. While traveling, you would like to use a modem on your laptop computer to connect directl
    5·1 answer
  • In the negative side of the battery, there are millions and millions of _________.
    14·1 answer
  • What is the most common type of communication?
    10·1 answer
  • NEXT
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!