Quadratic Formula Calculator


I created a simple quadratic formula calculator on Python. This program is trying its hardest to be unbreakable. The users are required to enter values for coefficients a, b, and c. They can not be letters or anything other than numbers. The program will keep asking the user to enter the correct values until all three values are received. After receiving the three values from the user, the program will consider 4 cases:

- b^2 - 4 * a * c = 0: This is the case with only 1 root.
- 4 * a * c > b^2: This will lead to complex calculations, and the program cannot do complex.
- a = 0: The denominator can not be 0, so no roots are defined.
- Otherwise, the program will display the 2 roots.

No comments:

Post a Comment