Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a quadratic calculator in C++ for the expression: a x + bx+c=0 1. Declare variables a, b, c. Choose arbitrary values for these
Write a quadratic calculator in C++ for the expression: a x + bx+c=0 1. Declare variables a, b, c. Choose arbitrary values for these variable. Make sure that a is not zero and that the expresion inside the root is positive or zero to avoid working with imaginary numbers. 2. Find the two roots: x1 and x2 using the usual quadratic formula: -b62-4ac x = 29 3. As an example, if a=1, b=2, and c=1, you must display the result using the following form with each number showing 2 fractional digits: 1 x2.00 +2.00 x + 1.00 (x -1.00) (x -1.00) Note that because the roots in this example are negative (-1 and -1), the resulting factorization shows double negative signs. This is fine for the purposes of this assignment. 5. Find the maximum/minimum point using the formula: b 62 2a 4a display the result using that format (with parenthesis as shown above) and also with each number showing 2 fractional digits. 6. You must add comments to the code. The evaluation rubric includes: logic and code correctness, formatting (proper use of vertical alignment of C++ code), and explanation of steps (comments).
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Code include using namespace std void printrootsin...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