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 the discriminant is positive then the equation has two real roots. If the value of the discriminant 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 output to a file. 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

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.1: Function And Parameter Declarations
Problem 11E
icon
Related questions
Question
100%

COSC 1336 – Programming Fundamentals I
Program 8 – Simple Functions

Write in Python Program:

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 the discriminant is positive then the equation has two real roots. If the value of the discriminant 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 output to a file.


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

 

Please read the requirements and follow them.

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 8 images

Blurred answer
Knowledge Booster
Algebraic Expressions
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