about summary refs log tree commit diff
path: root/distance_calc/Distance Calculator/Form1.cs
diff options
context:
space:
mode:
author1970-01-01 00:00:00 +0000
committer1970-01-01 00:00:00 +0000
commita44b50790d15388889d8c6f0e7d9d903d14c7001 (patch)
treeff955630bc3087ee8f4d0965d96b111f6ef50878 /distance_calc/Distance Calculator/Form1.cs
parentchess monitor (diff)
downloadwf-a44b50790d15388889d8c6f0e7d9d903d14c7001.tar
wf-a44b50790d15388889d8c6f0e7d9d903d14c7001.tar.gz
wf-a44b50790d15388889d8c6f0e7d9d903d14c7001.tar.bz2
wf-a44b50790d15388889d8c6f0e7d9d903d14c7001.tar.xz
wf-a44b50790d15388889d8c6f0e7d9d903d14c7001.zip
distance calc
Diffstat (limited to 'distance_calc/Distance Calculator/Form1.cs')
-rw-r--r--distance_calc/Distance Calculator/Form1.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/distance_calc/Distance Calculator/Form1.cs b/distance_calc/Distance Calculator/Form1.cs
new file mode 100644
index 0000000..724190e
--- /dev/null
+++ b/distance_calc/Distance Calculator/Form1.cs
@@ -0,0 +1,43 @@
+using System;

+using System.Collections.Generic;

+using System.ComponentModel;

+using System.Data;

+using System.Drawing;

+using System.Linq;

+using System.Text;

+using System.Threading.Tasks;

+using System.Windows.Forms;

+

+namespace Distance_Calculator

+{

+    public partial class distanceCalculator : Form

+    {

+        public distanceCalculator()

+        {

+            InitializeComponent();

+        }

+

+        private void calculateButton_Click(object sender, EventArgs e)

+        {

+            try {

+                int hours = int.Parse(hoursTextBox.Text);

+                int mph = int.Parse(mphTextBox.Text);

+

+                outputListBox.Items.Clear();

+

+                for (int i = 1; i <= hours; i++) {

+                    outputListBox.Items.Add("After hour " + i +

+                        " the distance is " + i * mph);

+                }

+            }

+            catch (Exception ex) {

+                MessageBox.Show(ex.Message);

+            }

+        }

+

+        private void exitButton_Click(object sender, EventArgs e)

+        {

+            this.Close();

+        }

+    }

+}