SngRoot2 = (-sngCoEffB - Math.Sqrt(sngDiscriminant)) / _ SngRoot1 = (-sngCoEffB + Math.Sqrt(sngDiscriminant)) / _ SngDiscriminant = (sngCoEffB * sngCoEffB) - (4 * sngCoEffA _ VB.NET Private Sub btnCalculate_Click(ByVal sender As System.Object, _īyVal e As System.EventArgs) Handles btnCalculate.Click SngRoot2 = (-sngCoEffB - Math.Sqrt(sngDiscriminant)) / SngRoot1 = (-sngCoEffB + Math.Sqrt(sngDiscriminant)) / SngDiscriminant = (sngCoEffB * sngCoEffB) - (4 * sngCoEffA Add the following code for the Calculate button.Ĭ# private void btnCalculate_Click(object sender, EventArgs e) In the preceding code, you have created the Coefficient objects, Discriminant objects, as well as the Root objects. CodeĪdd the following namespaces to your code: Please note that my naming of objects may be different than yours. Use Visual Studio to create either a VB.NET or a C# Windows Forms Application and design the form to resemble Figure 1. The numbers a, b, and c are the coefficients of the equation, and can be distinguished by calling them the quadratic coefficient, the linear coefficient, and the constant or free term. In the previous expression, x represents an unknown, and a, b, and c represent known numbers such that a is not equal to 0. In algebra, a quadratic equation is any equation in the form of ax 2 + bx + c = 0. Hello, and welcome to my small article about Quadratic Equations.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |