12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- 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 WindowsFormsСигаева2ИС_ПР2
- {
- /// <summary>
- /// Класс Calculation для вычисления выражения
- /// </summary>
- public partial class Calculation : Form
- {
- /// <summary>
- /// Конструктор
- /// </summary>
- public Calculation()
- {
- InitializeComponent();
- }
- /// <summary>
- /// Кнопка для вычисления выражения
- /// </summary>
- /// <param name="sender"></param>
- /// <param name="e"></param>
- private void ButtonCalculation_Click(object sender, EventArgs e)
- {
- if
- (double.TryParse(textBoxA.Text, out double a) &&
- double.TryParse(textBoxX.Text, out double x) &&
- double.TryParse(textBoxC.Text, out double c) &&
- double.TryParse(textBoxD.Text, out double d))
- {
- double f = Math.Sqrt((c - d) * (Math.Pow(x, 2))) / x;
- double q = Math.Log((Math.Pow(x, 2)) + c) / ((0.7 * x) + (a*d));
- double n = (Math.Pow(10, -2)) / (c - (d * Math.Pow(x, 3)));
- double result = f + q + n;
- textBoxResult.Text += Environment.NewLine + result.ToString();
-
- }
-
- }
- }
- }
|