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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education