-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFrmFormelABC.cs
48 lines (38 loc) · 1.05 KB
/
FrmFormelABC.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 AbcFormelLöser
{
public partial class FrmFormelABC : Form
{
public FrmFormelABC()
{
InitializeComponent();
}
public void ABCFormelErgebniss()
{
int A = Int16.Parse(txtA.Text);
int B = Int16.Parse(txtB.Text);
int C = Int16.Parse(txtC.Text);
int z = 2 * A;
int i = -1 * B;
int b = B * B;
int y = 4 * A * C;
int j = b - y;
i = i / z;
double J = Math.Sqrt(j);
J = J / z;
DialogResult result = MessageBox.Show($"Dein Ergebinss ist: {i + J} und {i - J}", "Ergebniss", MessageBoxButtons.OK);
}
private void btnRechnen_Click(object sender, EventArgs e)
{
ABCFormelErgebniss();
}
}
}