Question
Write a C++ function called Polynomial that will return the value of a 1st 5th order polynomial of the form: y = A0 + A1x
Write a C++ function called Polynomial that will return the value of a 1st 5th order polynomial of the form: y = A0 + A1x + A2x2 + A3x3 + A4x4 + A5x5 Inputs to the function should include x and the polynomial coefficients, A0 A5. The function should use default values of 0 for A2 A5 so that it will work with polynomials that are 1st order, 2nd order, 3rd order, 4th order, or 5th order and unused higher-order coefficients do not need to be listed in the function call. Example: Function Polynomial could be used to evaluate a 1st order polynomial as follows: y = Polynomial(1,2,3); answer y = 2 + 3 x = 2 + 3(1) = 5 . Example: Function Polynomial could be used to evaluate a 5th order polynomial as follows: y = Polynomial( 2,3,4,5,6,7,8); answer y = 3 = 4x + 5x2 + 6x3 + 7x4 +8x5 = 3 + 4(2) = 5(2)2 +6(2)3 + 7(2)4 + 8(2)5 = 447
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started