Computers and Technology

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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:10, sammigrace5820
How might the success of your campaign be affected if you haven’t carefully completed all field data or if you accidentally insert the wrong merge field in the document?
Answers: 1
image
Computers and Technology, 23.06.2019 03:30, bellsbella34
Ihave a singular monitor that is a tv for my computer. recently, i took apart my computer and put it back together. when i put in the hdmi cord and booted the computer to see if it worked, the computer turned on fine but the screen was blue with "hdmi no signal." i've tried everything that doesn't require buying spare parts, any answer is appreciated!
Answers: 1
image
Computers and Technology, 23.06.2019 22:30, BilliePaul95
Janice usually works on a particular workbook that contains all business related data. she decides to keep a backup of all the data in a separate workbook. she opens a new workbook to transfer the data. which option should she use to copy all the data from one workbook to another workbook?
Answers: 1
image
Computers and Technology, 24.06.2019 16:00, nothingworksoutforme
Your is an example of personal information that you should keep private.
Answers: 1
Do you know the correct answer?
The two roots of a quadratic equation ax^2 + bx + c = 0 can be obtained using the following formula:...

Questions in other subjects: