subject

Write a user-defined function that adds or subtracts two polynomials of any order. name the function p=polyadd(p1,p2,operation). the first two input arguments p1 and p2 are the vectors of the coefficients of the two polynomials. (if the two polynomials are not of the same order, the fuction adds the necessary zero elements to the shorter vector.) the thrid input arguement 'operation' is a string that can be either 'add' or 'sub', for adding or subtracting the polynomials, respectively, and the output arguement is the resulting polynomial. use the function to add and subtract the following polynomials: f1(x)=x^5-7x^4+11x^3-4x^2-5x-2f2(x) =9x^2-10x+6in your comments be sure to include a description of the function, it's inputs, and it's outputs, as well as the results from adding and subtracting the two equations listed. if the user doesn't enter 'add' or 'sub' as an option, you may simply print an error message and exit the function. there is no need to ask them to re-enter any inputs.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 08:10, autumnguidry1622
Technician a says that if a valve is open when a piston rises to the very top of a cylinder, the piston may actually strike the valve head and cause serious engine damage. technician b says if the camshaft is located in the engine block, then the engine is called an overhead valve engine, ohv engine, or an in-block camshaft. who is right? a. b only b. both a and b c. a only d. neither a nor b
Answers: 3
image
Computers and Technology, 22.06.2019 19:00, trintrin227
In he example code, what does the title attribute create? a tool tip an element a source a markup
Answers: 1
image
Computers and Technology, 22.06.2019 22:00, zay179
What is a distinguishing feature of today’s graphic application software?) graphic applications are used today on a variety of devices, including touch-screen kiosks and mobile phones.
Answers: 3
image
Computers and Technology, 22.06.2019 22:50, cheyennecarrillo14
Which is the best minecraft server? a. mineplex b. worldonecraft c. 9b9t d. 2b2t
Answers: 2
You know the right answer?
Write a user-defined function that adds or subtracts two polynomials of any order. name the function...

Questions in other subjects:

Konu
Geography, 08.01.2021 05:30