Write a program in a script file that determines the real roots of a quadratic equation ax2 + bx + c1 answer below »

Write a program in a script file that determines the real roots of a quadratic equation ax2 + bx + c = 0. Name the file quadroots. When the file runs, it asks the user to enter the values of the constants a, b, and c. To calculate the roots of the equation the program calculates the discriminant D, given by: D = b2 - 4ac If D > 0, the program displays message "The equation has two roots," and the roots are displayed in the next line. If D = 0, the program displays message "The equation has one root," and the root is displayed in the next line.

import time
import os
import threading
import sys
import math
import csv
import calendar
import datetime
from math import sin
from math import cos
import os
from os import listdir
import random
import itertools
import re
import operator

a = float(input('Please enter the coefficients a: '))
b = float(input('Please enter the coefficients b: '))
c = float(input('Please enter the coefficients c: '))

print(Quadratic Equation: %s x^2 + %s x + %s%(a,b,c))

## 1 Approved Answer

March 08, 2020Script File in Python

*********************************************************************************

import time

import os

import threading

import sys

import math

import csv

import calendar

import datetime

from math import sin

from math import cos

import os

from os import listdir

import random

import itertools

import re

import operator

a = float(input('Please enter the coefficients a: '))

b = float(input('Please enter the coefficients b: '))

c = float(input('Please enter the coefficients c: '))

print(Quadratic Equation: %s x^2 + %s x + %s%(a,b,c))

d = (b*b) - (4*a*c)

## Do you need an answer to a question different from the above? Ask your question!

Tell us more

(Hide this section if you want to rate later)

Was the final answer of the question wrong?

Were the solution steps not detailed enough?

Was the language and grammar an issue?

Does the question reference wrong data/report

or numbers?

Stay Solved :)

5 seconds## Didn't find yours?

Ask a new questionGet plagiarism-free solution within 48 hours

Review Please