Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.53 KB | None | 0 0
  1. using System;
  2. using System.Windows.Forms;
  3.  
  4. namespace Laba3
  5. {
  6.     public partial class Form2 : Form
  7.     {
  8.         public Form2()
  9.         {
  10.             InitializeComponent();
  11.         }
  12.         double Vvod(TextBox t)
  13.         {
  14.             return Convert.ToDouble(t.Text);
  15.         }
  16.         void Vivod(TextBox t, double z)
  17.         {
  18.             t.Text = z.ToString("F5");
  19.         }
  20.         double Duga1(double r1, double a)
  21.             {
  22.                 double str = 2 * Math.PI * r1 * (a / 360);
  23.                 return str;
  24.             }
  25.  
  26.         void Dlina(double r1, double a, double r2, double b, double r3, double c, ref double l1, ref double l2, ref double l3)
  27.         {
  28.             l1 = Duga1(r1, a);
  29.             l2 = Duga1(r2, b);
  30.             l3 = Duga1(r3, c);
  31.         }
  32.         private void Button1_Click(object sender, EventArgs e)
  33.  
  34.         {
  35.             double r1, r2, r3, a, b, c;
  36.             double l1 = 0;
  37.             double l2 = 0;
  38.             double l3 = 0;
  39.             r1 = Vvod(textBox1);
  40.             r2 = Vvod(textBox3);
  41.             r3 = Vvod(textBox5);
  42.             a = Vvod(textBox2);
  43.             b = Vvod(textBox4);
  44.             c = Vvod(textBox6);
  45.             Dlina(r1, a, r2, b, r3, c, ref l1, ref l2, ref l3);
  46.             Vivod(textBox7, l1);
  47.             Vivod(textBox8, l2);
  48.             Vivod(textBox9, l3);
  49.         }
  50.         private void Button2_Click(object sender, EventArgs e)
  51.         {
  52.             Form1 f1 = new Form1();
  53.             this.Hide();
  54.             f1.Show();
  55.         }
  56.     }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement