Beispiel #1
0
        private void btnHitungFaktorial_Click(object sender, RoutedEventArgs e)
        {
            int faktorial, res;

            faktorial = int.Parse(txtBoxFaktorial.Text);

            res = Fungsi.faktorial(faktorial);

            lblHasilFaktorial.Content = res.ToString();
        }
        private void btnHitungAritmetika_Click(object sender, RoutedEventArgs e)
        {
            double a, b, n, Un, Sn;

            a = double.Parse(txtBoxAritmetikaA.Text);
            b = double.Parse(txtBoxAritmetikaB.Text);
            n = double.Parse(txtBoxAritmetikaN.Text);

            Un = Fungsi.deretAritmetikaUn(a, b, n);
            Sn = Fungsi.deretAritmetikaSn(a, n, Un);

            lblHasilUnAritmetika.Content = Un.ToString();
            lblHasilSnAritmetika.Content = Sn.ToString();
        }
        private void btnHitungBalok_Click(object sender, RoutedEventArgs e)
        {
            double p, l, t, lp, vol;

            p = double.Parse(txtBoxBalokP.Text);
            l = double.Parse(txtBoxBalokL.Text);
            t = double.Parse(txtBoxBalokT.Text);

            lp  = Fungsi.luasBalok(p, l, t);
            vol = Fungsi.volumeBalok(p, l, t);

            lblHasilBalokLuas.Content   = lp.ToString();
            lblHasilBalokVolume.Content = vol.ToString();
        }