Beispiel #1
0
        private void task2(object sender, RoutedEventArgs e)
        {
            textBox_unsver.Text = "";

            //2 Fibonacci sequence
            int[] fibonacci = FibonacciSequence.getFibonacci(ValidInspector(textBox_user.Text));

            foreach (int i in fibonacci)
            {
                textBox_unsver.Text += i + " ";
            }

            textBox_task.Text = "2.  A Fibonacci sequence is the sequence of numbers" +
                                " 1, 1, 2, 3, 5, 8, 13, 21, 34, and so on," +
                                " where each number (from the third on) is the" +
                                " sum of the previous two. Create a method " +
                                "that takes an integer as an argument and " +
                                "displays that many Fibonacci numbers starting " +
                                "from the beginning, e.g., If you run java Fibonacci " +
                                "5 (where Fibonacci is the name of the class) the " +
                                "output will be: 1, 1, 2, 3, 5.";
        }