Question
This assignment maps to Chapter 3 and reinforces the use of arithmetic operations in C++. Implement a program that translates the quadratic formula into an
This assignment maps to Chapter 3 and reinforces the use of arithmetic operations in C++.
Implement a program that translates the quadratic formula into an expression. Use the sqrt and pow function to reconstruct this expression.
The expression is: x 3x - 10 = 0
Don't worry about making this adapt to other expressions. We don't want to deal with imaginary number cases. We're just trying to prove our competence with arranging the order of operations and expressions. Only use that expression above.
This assigns a, b, and c to:
a = 1
b = -3
c = -10 The equation will have to evaluate the + and - case, so the equation should be stored into two separate variables for both cases.
The roots should read: 5 and -2 in your console window as shown:
IMPORTANT:
Your code does not have to account for non real numbers.
Your code will only evaluate the one test expression given to you.
Your code will not deal with equations that have no solutions or roots.
This exercise is a display of proper expression conversion, use of cmath library, and possibly typecasting. Focus primarily on the order of operations. That's what I'm looking for in grading.
Quadratic Formula Example Equation x2+ 2x 10 - 4ac 1 2a a bCStep 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