Download presentation
Presentation is loading. Please wait.
Published byClarence Ford Modified over 8 years ago
1
QuadraticEquation class
2
Background A quadratic equation is a second-order polynomial equation in a single variable x, ax 2 + bx + c = 0 (with a≠0.)
3
Quadratic Formula The solutions of a quadratic equation (often called finding the zeros of the equation) can be found using the Quadratic Formula:
4
More about the Quadratic Formula There could be zero, one or two solutions to any Quadratic Equation. In order to calculate a square root, you will need to use a method in the Math class Math.sqrt(b*b-4*a*c)
5
Overview of the code. public class QuadraticEquation { int a; int b; int c; public QuadraticEquation(int aa, int bb, int cc) { /* Fill in the code for the constructor to store the coeficients */ } public boolean hasSolutions() { /* Fill in the code and return either true or false*/ } public double firstSolution() { /* return the value of one of the solutions to the Q.E. */ } public double secondSolution() { /* return the value of one of the solutions to the Q.E. */ } public void displaySolutions() { /* This is the only method in which you will print to screen. You must call on the other three methods within this method. */} }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.