12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- 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 KarpechinCalculator
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- public static double sum(double a, double b)
- {
- return a + b;
- }
- public static double razn(double a, double b)
- {
- return a - b;
- }
- public static double umnog(double a, double b)
- {
- return a * b;
- }
- public static double del(double a, double b)
- {
- return a / b;
- }
- public static double step(double a, double b)
- {
- return Math.Pow(a, b);
- }
- public static double koren(double a, double b)
- {
- return Math.Pow(a, 1 / b);
- }
- private void button1_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(sum(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
-
- private void button4_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(razn(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- private void button2_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(umnog(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- private void button5_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(del(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- private void button3_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(step(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- private void button6_Click(object sender, EventArgs e)
- {
- textBox3.Text = Convert.ToString(koren(Convert.ToDouble(textBox1.Text), Convert.ToDouble(textBox2.Text)));
- }
- }
- }
|