![Problem Solving with C++ (9th Edition)](https://www.bartleby.com/isbn_cover_images/9780133591743/9780133591743_largeCoverImage.gif)
(This Project requires that you know some basic facts about complex numbers, so it is only appropriate if you have studied complex numbers in some mathematics class.)
Write a C++ program that solves a quadratic equation to find its roots. The roots of a quadratic equation
ax2 + bx + c = 0 |
(where a is not zero) are given by the formula
(−b ± sqrt(b2 − 4ac)) / 2a |
The value of the discriminant (b2 − 4ac) determines the nature of roots. If the value of the discriminant is zero, then the equation has a single real root. If the value of the discriminant is positive then the equation has two real roots. If the value of the discriminant is negative, then the equation has two complex roots.
The program takes values of a, b, and c as input and outputs the roots. Be creative in how you output complex roots. Include a loop that allows the user to repeat this calculation for new input values until the user says she or he wants to end the program.
![Check Mark](/static/check-mark.png)
Trending nowThis is a popular solution!
![Blurred answer](/static/blurred-answer.jpg)
Chapter 3 Solutions
Problem Solving with C++ (9th Edition)
- (Numerical) Using the srand() and rand() C++ library functions, fill an array of 1000 floating-point numbers with random numbers that have been scaled to the range 1 to 100. Then determine and display the number of random numbers having values between 1 and 50 and the number having values greater than 50. What do you expect the output counts to be?arrow_forwardPython Programming Part 2 Direction: Use PYTHON to solve this problem. Description: This part tests for two things. The program must identify all resistors in series or in parallel with each other and calculate the equivalent resistance for each group of resistors. Recall that total resistance of resistors in series are added up while the total conductance of those in parallel are added up. Input Format: The first line of the input consists of 1 integer N which is the total number of resistors. The next N lines will consist of 3 strings and an integer R each separated by a space. The first string is the resistor name, the second and third strings are the node names where the resistor terminals are connected, and R is its resistance value. Output Format: One line for each group of resistors in series or parallel. Each line starts with a list of resistors arranged in lexicographical order (see Lexicographic order - Wikipedia) followed by their total resistance rounded off to the nearest…arrow_forwardUse python fast 20 minutesarrow_forward
- Context: Using Python, I am also a beginner in programming. Having a hard time completing this practice and assisstance is appreciatedarrow_forwardPYTHON PROGRAMMING (practice review for final) (please see attached)arrow_forward[Python Language] A common back-of-the-envelope technique for estimating a runner’s marathon time is to take their best half-marathon time, multiply by two and add ten minutes. This works pretty well unless the marathon course is hilly.If it is hilly, we add an extra 20 minutes to the estimate. Write a program that takes two lines of input: a float giving the half- marathon time in minutes and an integer indicating whether the marathon course is hilly(1) or not (0). It prints a float giving the estimated number of minutes the runner will take to run the full marathon. Write your pro- gram in a file named marathon.py.arrow_forward
- Code the follow.arrow_forwardcan you do it in python, thank you.arrow_forwardIII C Question: Write a Python program to construct Newton's Divided difference interpolating polynomial to approximate f(2.7) using the following data from the table. X 2 2.5 3 3.5 4 y 0.6932 0.9163 1.0986 1.3672 1.5728 1) Find out the divided differences and print them in a table as follows. x₂ Second Third fourth Zeroth First divided divided divided divided divided difference difference difference difference difference 2) Print the approximate value of the function for the given value of x. (use 4 digit rounding)arrow_forward
- please do it in python language first picture is problem and second one is just hint for you. thanksarrow_forwardThank youarrow_forwardCode in Python Write a program to find the 6-th Monisen number. Classic Programming Question: find the n-th Monisen number. A number M is a Monisen number if M=2**P-1 and both M and P are prime numbers. For example, if P=5, M=2**P-1=31, 5 and 31 are both prime numbers, so 31 is a Monisen number. Put the 6-th Monisen number into a single text file and submit onlinearrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)