Java Programming QuestionDesign your interface as per given in sample run:
You can use any creative way to design your interface.
You are able to enter value of A, B and C in three differenttext box and when you click on Solve buttoncalculate the answer of quadratic equation as per followingconditions.
Clear button clear the content of 3 text fields.
For example, if you enter A=3, B=2 and C=7
Your Equation: Ax2 + Bx + C = 0 so3x2 + 2x + 7 = 0
Now find the value of X based on the different condition whichis explained here:
Solving the equation:
The quadratic formula
The discriminant is the part inside the square root symbol(b2 - 4ac).
If the discriminant = 0, there is exactly one root. This iscalculated by using the quadratic formula with the + symbol only(i.e. the positive square root of the discriminant).
If the discriminant is greater than 0, there are two roots. thisis calculated by using the quadratic formula twice, once with thepositive square root of the discriminant and once with the negativesquare root of the discriminant.
If the discriminant is less than 0, there is no solution andtherefore no roots (you can display "Solution: No Solution".
Following are sample run of program:
x = - b ± √b² 2a - 4 ac
Calculatorle.parseDouble Quadratic Equation Solver A Value: 3 B Value: 2 C Value: 7 Solve Solution: No Solution 0 Clear X
Calculator Quadratic Equation Solver A Value: 1 B Value: -5 C Value: -4 Solve Solution: x=5.70, x=-0.70 Clear X
Calculator Quadratic Equation Solver A Value: 9 B Value: 12 C Value: 4 Solve Solution: x= -0.67 x Clear
Java Programming Question Design your interface as per given in sample run: You can use any creative way to design your
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am