Problem 3 - Quadratic Equation Solution 0 solutions submitted (max: Unlimited) If a second order polynomial...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem 3 - Quadratic Equation Solution 0 solutions submitted (max: Unlimited) If a second order polynomial is written in the general form: then the roots (i.e. the values of x that satisfy the equation) can be determined using the quadratic formula: -b ± √b² - 4ac 2a Some code has already been provided to semi-randomly define the variables a, b, and c. Add commands to do the following: 1. Check if the roots of the polynomial defined by a, b, and care real and distinct. Note that the roots will be real if the value under the square root is greater than or equal to zero. They will not be distinct; however, if the value under the square root (b²-4ac) is exactly equal to zero. Assign an an integer value to the variable numRoots as follows: x= . The value 2 if the roots are real and distinct . The value 1 if the two roots are the same. ▪ The value 0 if the roots are not real (i.e. complex because the value under the square root is less than 0) 2. Assign the solution to the quadratic to the variable rootvalues according to the following guidelines: . In cases where there are two real and distinct roots, compute the two roots and assign them to a two-element row vector. The + value should be first and the value should be second (using the equation above) . In cases where the two roots are the same, compute the root and assign this value to both elements in a two-element row vector. ▪ In cases where the roots are complex, output assign the text 'complex roots' output variable rootvalues. The output text should be a character vector (this just means use single quotes around the text, as shown in the previous sentence). Use disp commands to show the number of roots and the root values. Use an if-elseif-else-end structure in your code. Do not overwrite the a, b, or c values in your code. Problem 3 - Quadratic Equation Solution 0 solutions submitted (max: Unlimited) If a second order polynomial is written in the general form: then the roots (i.e. the values of x that satisfy the equation) can be determined using the quadratic formula: -b ± √b² - 4ac 2a Some code has already been provided to semi-randomly define the variables a, b, and c. Add commands to do the following: 1. Check if the roots of the polynomial defined by a, b, and care real and distinct. Note that the roots will be real if the value under the square root is greater than or equal to zero. They will not be distinct; however, if the value under the square root (b²-4ac) is exactly equal to zero. Assign an an integer value to the variable numRoots as follows: x= . The value 2 if the roots are real and distinct . The value 1 if the two roots are the same. ▪ The value 0 if the roots are not real (i.e. complex because the value under the square root is less than 0) 2. Assign the solution to the quadratic to the variable rootvalues according to the following guidelines: . In cases where there are two real and distinct roots, compute the two roots and assign them to a two-element row vector. The + value should be first and the value should be second (using the equation above) . In cases where the two roots are the same, compute the root and assign this value to both elements in a two-element row vector. ▪ In cases where the roots are complex, output assign the text 'complex roots' output variable rootvalues. The output text should be a character vector (this just means use single quotes around the text, as shown in the previous sentence). Use disp commands to show the number of roots and the root values. Use an if-elseif-else-end structure in your code. Do not overwrite the a, b, or c values in your code.
Expert Answer:
Answer rating: 100% (QA)
Certainly heres the complete MATLAB code that includes the provided code along with the additional code to check the roots and display the results 1 Randomly Choose Coefficients Provided Code choice r... View the full answer
Related Book For
Basic Technical Mathematics
ISBN: 9780137529896
12th Edition
Authors: Allyn J. Washington, Richard Evans
Posted Date:
Students also viewed these programming questions
-
Calculate the macroscopic absorption cross section for aluminum given that a thermal flux of 2.91x10 8 neutrons/cm sec (E = 0.0253 eV) is incident on a 4.8 mm thick aluminum foil, and that after...
-
Which of these is the correct order of SDLC stages? Planning, requirement gathering, designing and prototyping, implementation, testing, deployment, and operations and maintenance. Planning,...
-
What are the main advantages and disadvantages of using 360 degree appraisal?
-
A manufacturer of high-strength, lowalloy steel beams requires that the standard deviation of yield strength not exceed 7000 pounds per square inch (psi). The quality-control manager selected a...
-
Does someone with authority always have power? Does a person who accepts responsibility necessarily have authority? Explain.
-
A university pumps its water from wells located on campus. The falling water table has caused pumping costs to increase, the quantity of water available to decrease, and the quality of water to...
-
Jan Volk, financial manager of Green Sea Transport (GST), has been asked by her boss to review GSTs outstanding debt issues for possible bond refunding. Five years ago, GST issued $40,000,000 of 11...
-
8. The electronic health record shows an order for 120 mL of 25 % formula to be administered in the nasogastric feeding tube every 2 hours between 0700 and 1900 each day. The 30 mL can of...
-
What is the payback for a project that requires a $10,100 initial investment and returns $3,200 the next year and $2,100 per year after that? a) The payback period is 3 years and 3 months. b) The...
-
"What role does symbolic interactionism play in the construction and perpetuation of social norms, and how do these norms evolve over time through processes of socialization and collective action?"
-
Erindale Bank offers you a $48,000, five-year term loan at 7.5 percent annual interest. What will your annual loan payment be? (Do not round intermediate calculations. Round the final answer to 2...
-
A man needed money to but lawn equipment. he borrowed $790.00 for five months and paid $67.96 in interest. what was the rate of interest? (round to one decimal place as needed)
-
In addition to out-of-pocket expenses, many health insurance plans have waiting periods and exclusions that limit what the insurance plan needs to pay in benefits. A waiting period is a set period of...
-
Mrs. Pulido, a Filipina residing in Malabon died a widow on October 1, 2000, leaving the following properties: A parcel of land in New York Php 1, 000, 000 House and lot (conjugal family home) 600,...
-
(b) JKL Company has developed monthly forecast and cost information in Table 5 and Table 6. The company would like to begin development of an aggregate plan. [Syarikat JKL telah membangunkan ramalan...
-
Starr Co. had sales revenue of $540,000 in 2014. Other items recorded during the year were: Cost of goods sold ..................................................... $330,000 Salaries and wages...
-
The area of a triangle with vertices (x 1 , y 1 ), (x 2 , y 2 ), and (x 3 , y 3 ) is given by (If the answer comes out negative, take the absolute value). A natural gas company locates the three...
-
Determine the center and radius of each circle. Sketch each circle. 2x 2 + 2y 2 = 4x + 8y + 1
-
Plot the given curves in polar coordinates. 1 2(sin0 - 1)
-
Reconsider the data of Problem 31. Data from Problem 31 The following three investment opportunities are available. The returns for each investment for each year vary, but the first cost of each is...
-
The following three investment opportunities are available. The returns for each investment for each year vary, but the first cost of each is $20,000. Based on a future worth analysis, which...
-
Explain the relationship between the finite sample \(F\)-test and the large sample \(\chi^{2}\)-test, and the assumptions under which each is suitable.
Study smarter with the SolutionInn App