subject

The two roots of a quadratic equation ax^2 + bx + c = 0 can be obtained using the following formula:r1 = (-b + sqrt(b^2 - 4ac)) / (2a)andr2 = (-b - sqrt(b^2 - 4ac)) / (2a)b^2 - 4ac is called the discriminant of the quadratic equation. If it is positive, the equation has two real roots. If it is zero, the equation has one root. If it is negative, the equation has no real roots. Write a program that prompts the user to enter values for a, b, and c and displays the result based on the discriminant. If the discriminant is positive, display two roots. If the discriminant is 0, display one root. Otherwise, display "The equation has no real roots".Note that you can use Math. pow(x, 0.5) to compute sqrt(x).Sample Run 1Enter a, b, c: 1.0 3 1The equation has two roots -0.381966 and -2.61803Sample Run 2Enter a, b, c: 1 2.0 1The equation has one root -1

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:30
This isn’t really school related, but like where the heck can you find manga, to read to where you don’t have to pay money, for points? my friend wants me to read bj alex, and i can’t find it anywhere for free.
Answers: 2
question
Computers and Technology, 23.06.2019 11:50
While preforming before operation pmcs, you notice the front right tire appears slightly under-inflated. what is the proper action?
Answers: 3
question
Computers and Technology, 24.06.2019 01:10
Create a program that will take in a single x and y coordinate as the origin. after the input is provided, the output should be all of the coordinates (all 26 coordinates read from the “coordinates.json” file), in order of closest-to-farthest from the origin.
Answers: 1
question
Computers and Technology, 24.06.2019 10:20
Write a program that keeps asking the user for new values to be added to a list until the user enters 'exit' ('exit' should not be added to the list). these values entered by the user are added to a list we call 'initial_list'. then write a function that takes this initial_list as input and returns another list with 3 copies of every value in the initial_list. finally, inside print out all of the values in the new list. for example: input: enter value to be added to list: a enter value to be added to list: b enter value to be added to list: c enter value to be added to list: exit output: a b c a b c a b c note how 'exit' is not added to the list. also, your program needs to be able to handle any variation of 'exit' such as 'exit', 'exit' etc. and treat them all as 'exit'.
Answers: 2
You know the right answer?
The two roots of a quadratic equation ax^2 + bx + c = 0 can be obtained using the following formula:...
Questions
question
Chemistry, 20.10.2020 03:01
question
Mathematics, 20.10.2020 03:01
question
History, 20.10.2020 03:01
question
Mathematics, 20.10.2020 03:01
question
English, 20.10.2020 03:01