Page 41 - E-Modul Pemrograman Dasar
P. 41

f)  Form volume tabung (frmTabung)


                        using System;
                        using System.Collections.Generic;
                        using System.ComponentModel;
                        using System.Data;

                        using System.Drawing; using System.Linq;
                        using System.Text;
                        using System.Windows.Forms;

                        namespace Luasdanvolume
                        {

                               public partial class frmTabung: Form
                               {
                                       public frmTabung()
                                       {

                                              InitializeComponent();
                                       }

                                       private void btnHitung_Click(object sender, EventArgs e)
                                       {

                                              double jari, tinggi, volume;
                                              jari double.Parse(txtJari.Text);
                                              tinggi double.Parse(txtTinggi.Text);
                                              volume = 3.14 jari jari tinggi;

                                              txtVolume.Text = Convert.ToString(volume);
                                       }

                                       private void btnkeluar_Click(object sender, EventArgs e)
                                       {

                                              this.Close();
                                       }
                               }
                        }







                                                             32
   36   37   38   39   40   41   42   43   44   45   46