‫Hello developers, and welcome back.
‫In this video we're going to review some mathematical concepts regarding how to solve the quadratic
‫equations.
‫Quadratic equations are algebraic equations that have the form a x squared plus b x plus c equals to
‫zero.
‫Considering this form, the discriminant of a quadratic equation is the value b squared minus four AC,
‫denoted by letter d.
‫This value goes inside the square root of the general quadratic formula, and determines the type of
‫a solution that will have.
‫For example, when d greater than zero, the quadratic equation has two real roots.
‫When d less than zero, the quadratic equation has no real roots.
‫When d equals to zero, the quadratic equation has a repeated root ax squared plus bx plus c equals
‫to zero.
‫The general solution for this formula is x equals two minus b plus radical b squared minus four AC over
‫two a and x equals to minus b minus radical b squared minus four AC over two a.
‫We can understand this better if we remember that the general quadratic equation formula, which allows
‫us to solve any quadratic equation, is x equals to minus b plus minus radical b squared minus four
‫AC over two a.
‫Let's move to Android Studio and start implementing this formula.
‫I'll create a new project Empty Views Activity and here I'll name it as Quadratic Equation Solver.
‫Select Kotlin and click finish.
‫And I'll copy this wallpaper from my desktop and paste it here in the drawable folder.
‫And it's called wallpaper.
‫Now I'll set this wallpaper as a background for the main activity.
‫Go to the main activity and the background will be drawable wallpaper.
‫And this is good.
‫Now let's move to the text view from here and name it as Equation Solver app color white is good and
‫the size would be 24.
‫Okay, this is good.
‫Now I'll create three edit texts one for A, one for B, and one for C.
‫Drag and drop it to here and infer the constraints again.
‫Guys, I'll create an edit text.
‫Drag and drop it to here and infer the constraints.
‫And this is the ID of this edit text and the third edit text.
‫Drag and drop this edit text and infer the constraints.
‫Okay, this is our layout.
‫Enter A, enter B and enter C.
‫These are the hints for the edit text.
‫Then we need to create a button here.
‫Wrap content.
‫Wrap content text will be solve the equation.
‫I'll drag and drop it to here and infer the constraints.
‫Also, I'll give it an ID button and we have to add a text view to display the result.
‫Wrap content wrap content ID would be result text and I need to add color white and just for testing
‫it will be result text size would be 24.
‫SP is good and the drag and drop this result text to here and infer the constraints.
‫So this is our layout.
‫We have three edit texts one text view for result and one button and this text view just a title.