Question
quadratic equation by PHP The purpose of this question is to develop a simple calculator for solving a quadratic equation of the form . The
quadratic equation by PHP
The purpose of this question is to develop a simple calculator for solving a quadratic equation of the form . The solution of the quadratic equation can be classified as a real or an imaginary solution. In this question you are required to apply two formulas for solving the quadratic equation; the discriminant formula and quadratic formula. The discriminant formula is applied for determining whether the quadratic equation has a real or imaginary solution, where the quadratic formula is applied for finding the real solution(s) of the quadratic equation. If the quadratic equation has a real solution, the calculator should find that real solution(s) by applying the quadratic formula. But if the quadratic equation has an imaginary solution, the calculator should notify only that there is an imaginary solution without finding that solution. In this question you might need to make a quick revision through the internet to remember how to solve the quadratic equation by using discriminant and quadratic formulas. The quadratic calculator should be implemented by using HTML tags and PHP codes. The final code with 2 snapshots should be provided in your answer sheet. The calculator software system starts by browsing the calculator web page with:
1- A suitable title.
2- A suitable header.
3- Three empty textboxes with suitable labels for holding the three coefficients A, B and C of the quadratic equation.
4- An empty textbox with suitable label for holding the real solution(s) or holding a notification for the imaginary solution.
5- Two buttons with suitable labels, one for solving the quadratic equation and the other for clearing all values displayed in the coefficients textboxes and the solution textbox. Note:
The design and the layout of the calculators web page are left intentionally for the student to show his/her creativity in this part. The PHP part of the calculator software system should include two functions as described below:
1- A PHP function for testing whether the quadratic equation has a real or an imaginary solution.
2- A PHP function for finding the real solution(s) of the quadratic equation. The calculator software system should satisfy the following requirements:
1- The numerical values of the coefficients A, B and C of the quadratic equation may be any numerical value except zero.
2- The solution(s) of the quadratic equation should be shown only in the solution textbox when all coefficients textboxes are filled with numerical values and after pressing on the button that allocated for starting the solving process. Otherwise a suitable message should be shown in the solution textbox to notify that at least one of the coefficients text boxes is filled with none numerical value.
3- A suitable message should be shown in the solution textbox when the quadratic equation has an imaginary solution.
4- The solution of the quadratic equation should be rounded to 3 decimal places.
5- The solution of other quadratic equations can be calculated by changing only the coefficients values in the textboxes and pressing on the button that allocated for starting the solving process.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started