Chapter
Quadratic Roots Revisited
From ComputerScienceOne by Dr Chris Bourke
Concepts
- How can conditionals validate input for a logarithm calculator?
"16. Conditionals\n\n1 #include <stdlib.h>\n\n2 #include <stdio.h>\n\n3 #include <math.h>\n\n4\n\n5 /**\n\n6 * This program computes the logarithm base b (b > 1)\n\n7 * of a given number x > 0\n\n8 */
- How can conditionals calculate tax brackets, credits, and total tax?
"16.3. Examples\n\n1 if(baseTax - credit >= 0) {\n\n2 totalTax = baseTax - credit;\n\n3 } else {\n\n4 totalTax = 0;\n\n5 }\n\nThe full program is presented in Code Sample 16.3.\n\n16.3.3. Quadratic Ro
- How can conditionals handle invalid inputs and special cases in a quadratic roots program?
"16.3.3. Quadratic Roots Revisited\n\nLet’s return to the quadratic roots program we previously designed that uses the quadratic equation to compute the roots of a quadratic polynomial by reading coef