Do not use built-in power function. And power must be >= 0 and integer. Do not
Fantastic news! We've Found the answer you've been seeking!
Question:
Do not use built-in power function. And power must be >= 0 and integer.
Do not use array or string etc.
Read inputs inside evaluate Polynomial function.
Display output in main function.
Transcribed Image Text:
x 1, ... , az x,a1 x', ao 1. Write a C++ function that evaluates polynomials an an x" + an-1 x°. It should take following inputs: Value of x. • Highest power n. Coefficients in descending order an, an-1, ... , a2 , ai , ao (coefficients will ne n+1) For instance, if x=4, n=3 & coefficients are [2,3,1,2], then output should be 182 which is obtained by evaluating the polynomial 2 * 43 +3 * 42+1 * 4+2 * 4° Function Prototype: double evaluatePolynomial(); Example01:* x = 4 p= 3 Enter 4 coefficients in descending order of power ***Marks: 02 2 3 1 2 output: 182 Example02: x= -2.5 p= 7 Enter 8 coefficients in descending order of power ****Marks: 02 -2 -4.6 1 output: 1032.265625 Example03:******* x = -2.5 p= 0 Enter 1 coefficients in descending order of power 7 10 :S******************** output: 7 *******Marks: 01 Example04:* x = -2.5 p=-4 output: Error (power must be >-0) x 1, ... , az x,a1 x', ao 1. Write a C++ function that evaluates polynomials an an x" + an-1 x°. It should take following inputs: Value of x. • Highest power n. Coefficients in descending order an, an-1, ... , a2 , ai , ao (coefficients will ne n+1) For instance, if x=4, n=3 & coefficients are [2,3,1,2], then output should be 182 which is obtained by evaluating the polynomial 2 * 43 +3 * 42+1 * 4+2 * 4° Function Prototype: double evaluatePolynomial(); Example01:* x = 4 p= 3 Enter 4 coefficients in descending order of power ***Marks: 02 2 3 1 2 output: 182 Example02: x= -2.5 p= 7 Enter 8 coefficients in descending order of power ****Marks: 02 -2 -4.6 1 output: 1032.265625 Example03:******* x = -2.5 p= 0 Enter 1 coefficients in descending order of power 7 10 :S******************** output: 7 *******Marks: 01 Example04:* x = -2.5 p=-4 output: Error (power must be >-0)
Expert Answer:
Answer rating: 100% (QA)
According to the guidance provided by dear student the array and inbuil... View the full answer
Related Book For
Financial Algebra advanced algebra with financial applications
ISBN: 978-0538449670
1st edition
Authors: Robert K. Gerver
Posted Date:
Students also viewed these programming questions
-
Use the definition of the greatest integer function to evaluate each of the following. a. [55.9] b. [55.001] c. [0.65] d. [34.11] e. [16 3 / 14] f. [8.21] g. [19] h. [0.45] i. [- 8 1 / 2] j. [ 2 / 3]
-
Evaluate the following limits, or show that they do not exist. (a) (b) (c) (d) (e) (f) (g) (h) lim (x 2)/vx (x >0) lim (x 2)/Vx (x>0), lim (vx+1)/x (x-1) lim (Vx 1)/x (x> 0) (0
-
Do people use quantitative or qualitative research to evaluate movies? Explain.
-
How does inventory turnover provide information about a companys short-term liquidity?
-
Arnold Corporation plans to acquire all the assets of Turner Corporation in an asset-for-stock exchange. Turners assets have a $600,000 adjusted basis and a $1 million FMV. Which of the following...
-
To test H0: = 45 versus H1: 45, a simple random sample of size n = 40 is obtained. (a) Does the population have to be normally distributed to test this hypothesis by using the methods presented in...
-
On February 11, 2009, plaintiff Levista, Inc. (plaintiff) filed against defendant Ranbaxy Pharmaceuticals, Inc. (defendant), pursuant to this Courts diversity jurisdiction under 28 U.S.C. 1332(a),...
-
The following information shows last year's quality-related costs for the Madrigal Company: Total sales for the year were $120,000,000.Required(a) Prepare a cost-of-quality report grouping costs into...
-
2. Two 2.5 kg masses are connected through a string as shown below. The magnitude of the force of friction on the ramp is 4.85 N. If the ramp is 5m long and mass 2 is already half way up the ramp,...
-
Peta is married, filing joint with two other dependents, is paid $17.25 per hour, and receives commission on sales. No commission is paid out until sales exceed $60,000. Once the minimum sales have...
-
Jefferson Co. has $2 million in total assets and $3 million in sales. The company has the following balance sheet: Cash Accounts receivable Inventories Net fixed assets Total assets $ 100,000 200,000...
-
What are the uses of recombinant DNA pharmaceuticals?
-
Employer Summary: Kelly is the senior finance manager for Achieve Financial Services and has been tasked with hiring a new financial analyst for their growing international portfolio. Many...
-
A systems analysis is required when: An agency wishes to purchase multiple expense items and the aggregate cost exceeds the expense/investment threshold. A unit intends to purchase multiple...
-
Please solve: log (base 4) (x^2 - 3) + log (base 4) 10 = 1
-
Given the following information for A&M Products "Onward 2025" project, find the discount rate needed to make the project break-even (NPV=$0). A&M's tax rate is 21%. Depreciation is calculated on a...
-
tell us about a product or service that has been a hit by changing the product's target or the company's position. And why do you think it worked
-
What is master production scheduling and how is it done?
-
Examine this portion of an amortization table for an adjustable rate mortgage that had a 1 year initial rate period of 4.25% and increased to 5.25% after that period ended. Determine the missing...
-
Harley built a concrete patio in her backyard. It is a free-form shape and she needs to find the area of it for property tax purposes. a. She takes a diagram of the patio and places it inside a 30-ft...
-
What was the approximate net change from April 29 to April 30? Express that net change as a monetary amount and as a percent to the nearest tenth. WPO Daily - 695 690 685 680 675 670 665 660 655 650...
-
For the Lyman series, what is the wavelength of the line with the second longest wavelength? Would it be visible to the human eye?
-
In 1924 French theorist Louis de Broglie (1892 1987, Nobel laureate in physics 1929) proposed that matter has a wavelike nature expressed by \(\lambda=\frac{h}{m v}\). Show that his relation agrees...
-
This problem presents an example of the Correspondence Principle. Suppose that the electron in hydrogen is traveling in a circular orbit with quantum number \(n\) and makes a transition to \(n+1\),...
Study smarter with the SolutionInn App