(a) Write a Python function called lroot to calculate the largest root of the quadratic equation...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(a) Write a Python function called lroot to calculate the largest root of the quadratic equation ax² +bx+c= 0. Your function should take the coefficients a, b and c as arguments and return the largest root of the equation. (b) Write a Python function called nroot that takes the coefficients a, b and c of the quadratic equation as arguments, and returns the number of real roots of the equation. (c) Use your functions from parts (a) and (b) to calculate the largest root and the number of real roots of the equation 5x2+8x − 2 =0. Activate Windows (a) Write a Python function called lroot to calculate the largest root of the quadratic equation ax² +bx+c= 0. Your function should take the coefficients a, b and c as arguments and return the largest root of the equation. (b) Write a Python function called nroot that takes the coefficients a, b and c of the quadratic equation as arguments, and returns the number of real roots of the equation. (c) Use your functions from parts (a) and (b) to calculate the largest root and the number of real roots of the equation 5x2+8x − 2 =0. Activate Windows
Expert Answer:
Answer rating: 100% (QA)
Python import math def lroota b c discriminant b 2 4... View the full answer
Related Book For
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang
Posted Date:
Students also viewed these programming questions
-
A runner is jogging at a steady 6.9 km/hr. When the runner is 3.5 km from the finish line, a bird begins flying from the runner to the finish line at 27.6 km/hr (4 times as fast as the runner). When...
-
Write an Python function called loops that takes no parameters and returns Nothing. The function begins by asking the user to enter two positive integers that you assign to two variables n and p...
-
This project is a continuation of the previous project. For a quadratic expression such as ax 2 + bx + c, a real root is any double number x such that ax 2 + bx + c = 0. For example, the quadratic...
-
What are the four key building blocks of financial statement analysis? a. Liquidity and efficiency, solvency, profitability, and market b. Liquidity and efficiency, solvency, profitability, and...
-
A study concludes that the use of pesticides is associated with the development of Parkinson's disease, a neurological disease that causes people to shake. The study reported that exposure to bug...
-
Find the angle between each pair of vectors. a. a = (1, 5, -1). b = (0, 1, 3) b. a = -i + 2k, b = i - j + 3k
-
The adjusted trial balance for Destination Realty, Inc., at October 31, 2010, follows: Requirements 1. Prepare Destination Realtys income statement, statement of retained earnings, and year-end...
-
The Dallas Mavericks basketball team has hired you as its new accountant. On your first day on the job, Mavericks owner, Mark Cuban, comes to you and asks, How many tickets must we sell to pay for...
-
Evaluate using the ratio test n=1 2n! 7 10 13 (3n+4) E
-
Can you make the journal entries for the transactions below: Dec. 1 - Sold merchandise to Argem Day Care Center for P20,000 and received a 3-month, 12% note. 2 - Purchased merchandise from Stephen...
-
Graham has the house in perfect order. Graham alphabetizes all the cans in the pantry, and she gets very upset if there is any clutter or dust in the house. Graham recently went for therapy...
-
COMM201 - W6 ACTIVITY 1. Write down your 10 top strengths i.e., communication, time management etc. Explain with everyday example in a short paragraph (2 to 3 lines only) that how it is your top...
-
State X, which is already a party to the New York Convention, is planning on adopting the UNCITRAL Model Law on International Commercial Arbitration. However, State X is unsure whether to select...
-
An alpha particle (q = 3.2 x 10 -19 C and m = 6.6 x 10 -27 kg) travels at a speed of 8.0 x 10 6 m / s in the +x direction. A uniform magnetic field with a magnitude of 1.2 T is pointed in the +y...
-
The following data were selected from the records of Tunga Company for the year ended December 31, current year. Balances at January 1, current year Accounts receivable (various customers) Allowance...
-
Provide an explanation about how you determine the project status based on the data? Provide an explanation about how process, project, and product metrics each explain a different part of your...
-
Suppose a financial institution uses a loan base rate of 7.10% and sets the credit risk premium at 6.55%. The institution charges a 3.10% loan origination fee and imposes 3.85% compensating balances....
-
Graph the following conic sections, labeling vertices, foci, directrices, and asymptotes (if they exist). Give the eccentricity of the curve. Use a graphing utility to check your work. 10 5 + 2 cos 0
-
Write a program that enables two users to chat. Implement one user as the server (Figure 31.21a) and the other as the client (Figure 31.21b). The server has two text areas: one for entering text and...
-
Write a program that animates the merge of two sorted lists. Create two arrays, list1 and list2, each of which consists of 8 random numbers from 1 to 999. The array elements are displayed, as shown...
-
Write a program that draws various figures, as shown in Figure 16.36b. The user selects a figure from a radio button and uses a check box to specify whether it is filled. StackPane Ellipse Fill <...
-
In a survey of a simple random sample of students at a certain college, the sample mean time per week spent watching television was 18.3 hours and the margin of error for a 95% confidence interval...
-
Use the data in Exercise 4 to construct a 95% confidence interval for the mean IQ score. Exercise 4 An IQ test was given to a simple random sample of 75 students at a certain college. The sample mean...
-
The lifetime of a certain type of battery is known to be normally distributed with standard deviation = 20 hours. A sample of 50 batteries had a mean lifetime of 120.1 hours. It is desired to...
Study smarter with the SolutionInn App