Form1.cs 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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 Zharushkin_calculator
  11. {
  12. public partial class Form1 : Form
  13. {
  14. public static double sum(double a, double b)
  15. {
  16. return a + b;
  17. }
  18. public static double razn(double a, double b)
  19. {
  20. return a - b;
  21. }
  22. public static double umnog(double a, double b)
  23. {
  24. return a * b;
  25. }
  26. public static double del(double a, double b)
  27. {
  28. return a / b;
  29. }
  30. public static double step(double a, double b)
  31. {
  32. return Math.Pow(a, b);
  33. }
  34. public static double koren(double a, double b)
  35. {
  36. return Math.Pow(a, 1 / b);
  37. }
  38. public Form1()
  39. {
  40. InitializeComponent();
  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. private void button3_Click(object sender, EventArgs e)
  51. {
  52. textBox3.Text = Convert.ToString(umnog(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  53. }
  54. private void button4_Click(object sender, EventArgs e)
  55. {
  56. textBox3.Text = Convert.ToString(del(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  57. }
  58. private void button5_Click(object sender, EventArgs e)
  59. {
  60. textBox3.Text = Convert.ToString(step(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  61. }
  62. private void button6_Click(object sender, EventArgs e)
  63. {
  64. textBox3.Text = Convert.ToString(koren(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
  65. }
  66. private void textBox1_TextChanged(object sender, EventArgs e)
  67. {
  68. }
  69. private void textBox2_TextChanged(object sender, EventArgs e)
  70. {
  71. }
  72. private void textBox3_TextChanged(object sender, EventArgs e)
  73. {
  74. }
  75. }
  76. }