Advertisement
Foxxything

testLongJump

May 6th, 2021
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.23 KB | None | 0 0
  1. /*
  2.  * name: Daryl Pinkerton
  3.  * date: 05.6
  4.  * teacher: mr.wach
  5.  * assiment: Long Jump (Test p.2)
  6.  * disription: crate a app that lets you avrage out the jumps from 4 jumps
  7.  */
  8.  
  9. using System;
  10. using System.Collections.Generic;
  11. using System.ComponentModel;
  12. using System.Data;
  13. using System.Drawing;
  14. using System.Linq;
  15. using System.Text;
  16. using System.Threading.Tasks;
  17. using System.Windows.Forms;
  18.  
  19. namespace longJump
  20. {
  21.     public partial class Form1 : Form
  22.     {
  23.         public Form1()
  24.         {
  25.             InitializeComponent();
  26.         }
  27.  
  28.         private void btnEnter_Click(object sender, EventArgs e)
  29.         {
  30.             //making all values a doble
  31.             double first = Convert.ToDouble(txt1st.Text);
  32.             double second = Convert.ToDouble(txt2nd.Text);
  33.             double third = Convert.ToDouble(txt3rd.Text);
  34.             double forth = Convert.ToDouble(txt4th.Text);
  35.  
  36.             //adding it all up
  37.             double totle = (first + second + third + forth);
  38.  
  39.             //dividing
  40.             double avrage = (totle/4);
  41.  
  42.             MessageBox.Show($"long jumps avraged is: {avrage}");
  43.         }
  44.  
  45.         private void btnExit_Click(object sender, EventArgs e) => Application.Exit();
  46.     }
  47. }
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement