Question: Part Two ( 2 0 pts . ) Modify the StringStuff DesktopApplication You Just Did Start with your completed StringStuff Calculator Application from the exercise

Part Two (20 pts.)
Modify the StringStuff DesktopApplication You Just Did
Start with your completed StringStuff Calculator Application from the exercise above. Add a
method that receives the word entered as an argument and returns a string with a $ added
after each character. For example if the word entered is Hello, the string returned is
H$e $1$1$0$.
Add a label that says Dollar Signs and a label next to it for outputting the string with the
added dollar signs. Your Transform button event handler should call your new method and
output the string with the dollar signs.
Once you finished all of the above and tested it to make sure that it works properly, paste a
copy of your C# source code showing your entire Transform button click event handler and
your new method. Also paste a screen print of the application running after the word Hello
has been entered and the Transform button selected. My code is : namespace StringStuffApp
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void btnTransform_Click(object sender, EventArgs e)
{
string inputWord = txtInput.Text;
lblSwitchCase.Text = "Switch Case: "+ SwitchCase(inputWord);
lblReverse.Text = "Reverse: "+ Reverse(inputWord);
lblPigLatin.Text = "Pig Latin: "+ ToPigLatin(inputWord);
}
private string SwitchCase(string word)
{
char[] buffer = word.ToCharArray();
for (int i =0; i buffer.Length; i++)
{
char c = buffer[i];
if (char.IsUpper(c))
{
buffer[i]= char.ToLower(c);
}
else if (char.IsLower(c))
{
buffer[i]= char.ToUpper(c);
}
}
return new string(buffer);
}
private string Reverse(string word)
{
char[] array = word.ToCharArray();
Array.Reverse(array);
return new string(array);
}
private string ToPigLatin(string word)
{
if (string.IsNullOrEmpty(word))
return string.Empty;
string firstLetter = word.Substring(0,1).ToLower();
string restOfWord = word.Substring(1).ToLower();
return restOfWord + firstLetter +"ay";
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
}
}
} please use this to add on to
Part Two ( 2 0 pts . ) Modify the StringStuff

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!