Computers and Technology, 26.01.2020 02:31, americab512
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)
and
r2 = (-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”.
sample run 1
enter a: 1.0
enter b: 3
enter c: 1
the roots are -0.3819660112501051 and -2.618033988749895
sample run 2
enter a: 1
enter b: 2.0
enter c: 1
the root is -1.0
sample run 3
enter a: 1
enter b: 2
enter c: 3
the equation has no real roots
Answers: 3
Computers and Technology, 24.06.2019 01:30, shonnybenskin8
Hazel has just finished adding pictures to her holiday newsletter. she decides to crop an image. what is cropping an image?
Answers: 1
Computers and Technology, 24.06.2019 15:50, GreatBaconGamer
Subscribe to j p g a m e t u b e on you tube ?
Answers: 2
Computers and Technology, 25.06.2019 03:10, lokiliddel
Write a program to convert a person's height in inches into centimetres #and their weight in stones into kilograms. (1 inch = 2.54 cm and 1 stone = 6.364 kg)
Answers: 1
Computers and Technology, 25.06.2019 08:30, asapmechee
Uses an iterative process that repeats the design, expansion, and testing steps as needed, based on feedback from users.
Answers: 1
The two roots of a quadratic equation ax^2 + bx + c = 0 can be obtained using the following formula:...
History, 02.07.2020 15:01