private void task3(object sender, RoutedEventArgs e) { // work with words //todo защита от неверного ввода textBox_unsver.Text = TextLetters.getCountVowels(textBox_user.Text) + "%"; textBox_task.Text = "3.Create a Set of the vowels.Count and " + "display the number of vowels in each input word, and also " + "display the total number of vowels in the input text, percent of each of them."; }
public void getCountVowelsText_Test() { float expected = (4 * 100) / 11; StringBuilder sb = new StringBuilder(); sb.Append("uiggddbifsa"); float actual = TextLetters.getCountVowels(sb); Assert.AreEqual(expected, actual); }
private void task4(object sender, RoutedEventArgs e) { if (textBox_user.Text != "") { textBox_unsver.Text = TextLetters.translateExpression(textBox_user.Text).ToString(); } else { textBox_unsver.Text = TextLetters.translateExpression("+U+n+c--+e+r+t--+a-+i-+n+t+y--+ -+r+u--+l+e+s--").ToString(); } textBox_task.Text = "4. Stacks are often used to evaluate expressions " + "in programming languages. Evaluate the following expression, " + "where’+’ means 'push the following letter onto the stack,' " + "and’-’ means 'pop the top of the stack and print it'" + ": ' + U + n + c—+e + r + t—+a - +i - +n + t + y—+-+r + u—+l + e + s—'"; }