Form1.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace Zubova_Калькулятор
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public Form1()
  15. {
  16. InitializeComponent();
  17. }
  18. public static double sum(double a, double b)
  19. {
  20. return a + b;
  21. }
  22. public static double razn(double a, double b)
  23. {
  24. return a - b;
  25. }
  26. public static double umnog(double a, double b)
  27. {
  28. return a * b;
  29. }
  30. public static double del(double a, double b)
  31. {
  32. return a / b;
  33. }
  34. public static double step(double a, double b)
  35. {
  36. return Math.Pow(a, b);
  37. }
  38. public static double koren(double a, double b)
  39. {
  40. return Math.Pow(a, 1 / b);
  41. }
  42. private void button1_Click(object sender, EventArgs e)
  43. {
  44. textBox3.Text = Convert.ToString(sum(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  45. }
  46. private void button2_Click(object sender, EventArgs e)
  47. {
  48. textBox3.Text = Convert.ToString(razn(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  49. }
  50. }
  51. }