Write a program that finds the roots of the quadratic equation using the Quadratic Formula. Write a function named discriminant in the file, Disc.py, to calculate and return the discriminant of the formula. Let the main function call the discriminant function and then calculate the solution(s) of the equation. Do not calculate the solutions in the discriminant functions.Allow the user to run the program as many times as possible until a sentinel value of zero (0), has been entered for the coefficient A. Include the recommended minimum documentation for each function. See the program one template for more details. Do not use any global variables.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter4: Selection Structures
Section: Chapter Questions
Problem 14PP
icon
Related questions
Question

The quadratic formula is used to solve a very specific type of equation, called a
quadratic equation. These equations are usually written in the following form:
ax2 + bx + c = 0
The Quadratic Formula

x = ( -b ± √( b^2 - 4ac ) ) / ( 2a )

Where a, b, and c are constants with a ≠ 0. (If a = 0, the equation is a linear equation.)
The discriminant is the part of the formula in the square root. If the value of the discriminant is zero then the equation has a single real root. If the value of thediscriminant is positive then the equation has two real roots. If the value of thediscriminant is negative, then the equation has two complex roots.
Write a program that finds the roots of the quadratic equation using the Quadratic Formula. Write a function named discriminant in the file, Disc.py, to calculate and return the discriminant of the formula. Let the main function call the discriminant function and then calculate the solution(s) of the equation. Do not calculate the solutions in the discriminant functions.Allow the user to run the program as many times as possible until a sentinel value of zero (0), has been entered for the coefficient A. Include the recommended minimum documentation for each function. See the program one template for more details.
Do not use any global variables.

Run your program at least four times with the data below. Copy and paste the outputsto a file.

Create a folder named, fullname_program8. Copy your source codes and
the output file to the folder. Zip the folder and upload it to Blackboard.
Run 1   Run 2   Run 3   Run 4
a = 1    a = 1    a = 2    a = 4
b = 2   b = -12 b = 9    b = 6
c = -8  c = 36   c = -5   c = 20

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning