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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Which of the following physical laws can make the flow of water seem more realistic? a. motion b. gravity c. fluid dynamics d. thermodynamics
Answers: 2
question
Computers and Technology, 23.06.2019 06:00
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
question
Computers and Technology, 23.06.2019 18:40
Johnson enterprises uses a computer to handle its sales invoices. lately, business has been so good that it takes an extra 3 hours per night, plus every third saturday, to keep up with the volume of sales invoices. management is considering updating its computer with a faster model that would eliminate all of the overtime processing.
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
Questions on the website: 13722362