PE: POLYNOMIAL MANAGEMENT -Evaluation of a polynomial (degree, coefficients, value) -Addition of two polynomials -Multiplication of two polynomials -Subtraction of two polynomials -Division of two polynomials   NB: Each time the user must enter the degree and the coefficients of the polynomials concerned The report should contain: The algorithm The program The execution trace   PLease explain your code in a step-wise manner. Thanks in advanced!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

TPE: POLYNOMIAL MANAGEMENT

-Evaluation of a polynomial (degree, coefficients, value)

-Addition of two polynomials

-Multiplication of two polynomials

-Subtraction of two polynomials

-Division of two polynomials

 

NB: Each time the user must enter the degree and the coefficients of the polynomials concerned The report should contain: The algorithm The program The execution trace

 

PLease explain your code in a step-wise manner. Thanks in advanced!

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Hi sir! Please kindly arrange/transfer the Modified code snippet: you just did in an msword doc or pdf format. After the transfer please do verify if the code still executes because each time i transfer it to ms word or pdf, and i copy it from word/pdf, the code refuses to execute. I guess its due to the alignement of the codes onced converted to pdf. Please I will be very grateful if you help me with this task!❤️

Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

Hi sir! Please modify the Updated code :: such that the polynomial appears in the execution result before giving us the final answer. More importantly, I want it to display the power of the polynomial without necessarily including the "^" symbol.

Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

Hi sir! Please modify the Updated code :: such that the polynomial appears in the execution result before giving us the final answer. 

Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

Please write an algorithm for the Updated code  you just did earlier. 

The algorithm should be a program that explains what the code does exactly. This algorithm should be written with python programming statements like if, else, while, for, endif, end etc)

Nb: Algorithm code

Below is an example of an algorithm am talking about 

Variables.
whole degree
coefficients: array of reals coefficient, number, image: reals
i: integer
Beginning
Write "Enter the degree of the polynomial P(x) you want: coefficients []
Read degree
For i ranging from 0 to degree Do Write "Enter the coefficient for the monomial x^", i, Add coefficient to coefficients
Read coefficient
End if
Write "The polynomial P(x) is: "For i ranging from 0 to degree Do
AND
If coefficients [i] != 0 Then If i = 0 Then
Write coefficients[i]
Elseif i 1 Then
If coefficients [i] < 0 Then
Write "-", -coefficients[i], "x"
Otherwise
Write "+", coefficients [i], "x"
Finnish
Otherwise
If coefficients[i] < 0 Then
Write "-", -coefficients [i], "x^", i
Otherwise
Write "+", coefficients[i], "x^", i
End if
End if
End if
EndFor
Write "Enter a number to calculate its image by P(x):
Read number frame-0
For i going from 0 to degree Make
image image + coefficients [i] (nombre)^i
EndFor
Write "The image of ", number," by P(x) is: ", image
END
Transcribed Image Text:Variables. whole degree coefficients: array of reals coefficient, number, image: reals i: integer Beginning Write "Enter the degree of the polynomial P(x) you want: coefficients [] Read degree For i ranging from 0 to degree Do Write "Enter the coefficient for the monomial x^", i, Add coefficient to coefficients Read coefficient End if Write "The polynomial P(x) is: "For i ranging from 0 to degree Do AND If coefficients [i] != 0 Then If i = 0 Then Write coefficients[i] Elseif i 1 Then If coefficients [i] < 0 Then Write "-", -coefficients[i], "x" Otherwise Write "+", coefficients [i], "x" Finnish Otherwise If coefficients[i] < 0 Then Write "-", -coefficients [i], "x^", i Otherwise Write "+", coefficients[i], "x^", i End if End if End if EndFor Write "Enter a number to calculate its image by P(x): Read number frame-0 For i going from 0 to degree Make image image + coefficients [i] (nombre)^i EndFor Write "The image of ", number," by P(x) is: ", image END
Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

Hi sir! Please I will like you to modify this code such that the program and algorithm should be similar to something like this. I have attached the image below. Your program is good yes and I do love it, but I will like you to modify something particular. I want you to remove those "^" at the results and i want it to display the power of the polynomial without necessarily including the "^". The image attached below illustrates what am saying. The code should equally display the polynomial before the actual result value. 

Also, I will like you to write the algorithm as a simple code(programming language) that explains what our actual code does, not just literature. You can do this by using the if, else, while, for loop, end etc.Please do ensure that the algorithm and code works once executed. Hope you get it! Please kindly write the algorithm for the entire code(evaluation, addition, subtraction, multiplication, division). Thanks in advanced!!!❤️

Enter the degree of the polynomial P(x) you want: 3
Enter the coefficient for the monomial xº: -2
Enter the coefficient for monomial X³: 4
Enter the coefficient for monomial x²: 0
Enter the coefficient for monomial X: 1
so we have P(x) = -2.0 + 4.0x + 1.0x²
now we can find the image by P of: -5
the image of -5.0 by p is: -147.0
Process finished with exit code 0
Transcribed Image Text:Enter the degree of the polynomial P(x) you want: 3 Enter the coefficient for the monomial xº: -2 Enter the coefficient for monomial X³: 4 Enter the coefficient for monomial x²: 0 Enter the coefficient for monomial X: 1 so we have P(x) = -2.0 + 4.0x + 1.0x² now we can find the image by P of: -5 the image of -5.0 by p is: -147.0 Process finished with exit code 0
Variables.
whole degree
coefficients: array of reals coefficient, number, image: reals
i: integer
Beginning
Write "Enter the degree of the polynomial P(x) you want: coefficients []
Read degree
For i ranging from 0 to degree Do Write "Enter the coefficient for the monomial x^", i, Add coefficient to coefficients
Read coefficient
End if
Write "The polynomial P(x) is: "For i ranging from 0 to degree Do
AND
If coefficients [i] != 0 Then If i = 0 Then
Write coefficients[i]
Elseif i 1 Then
If coefficients [i] < 0 Then
Write "-", -coefficients[i], "x"
Otherwise
Write "+", coefficients [i], "x"
Finnish
Otherwise
If coefficients[i] < 0 Then
Write "-", -coefficients [i], "x^", i
Otherwise
Write "+", coefficients[i], "x^", i
End if
End if
End if
EndFor
Write "Enter a number to calculate its image by P(x):
Read number frame-0
For i going from 0 to degree Make
image image + coefficients [i] (nombre)^i
EndFor
Write "The image of ", number," by P(x) is: ", image
END
Transcribed Image Text:Variables. whole degree coefficients: array of reals coefficient, number, image: reals i: integer Beginning Write "Enter the degree of the polynomial P(x) you want: coefficients [] Read degree For i ranging from 0 to degree Do Write "Enter the coefficient for the monomial x^", i, Add coefficient to coefficients Read coefficient End if Write "The polynomial P(x) is: "For i ranging from 0 to degree Do AND If coefficients [i] != 0 Then If i = 0 Then Write coefficients[i] Elseif i 1 Then If coefficients [i] < 0 Then Write "-", -coefficients[i], "x" Otherwise Write "+", coefficients [i], "x" Finnish Otherwise If coefficients[i] < 0 Then Write "-", -coefficients [i], "x^", i Otherwise Write "+", coefficients[i], "x^", i End if End if End if EndFor Write "Enter a number to calculate its image by P(x): Read number frame-0 For i going from 0 to degree Make image image + coefficients [i] (nombre)^i EndFor Write "The image of ", number," by P(x) is: ", image END
Solution
Bartleby Expert
SEE SOLUTION
Follow-up Question

Hello Sir! Hope you're fine!

I tested your code on various python platforms and none of them seems to be executing. Please kindly verify the codes above and assemble them in a word document once they are in tact. As soon as you're done with the codes, please send me the word doc or in pdf format. Thanks in advanced!!!❤️

← → C
Fiverr / cheryl_anna...
trinket
trinket.io/python
Privacy Terms
fi Fiverr / Inbox
4
5
6
7
CONTENEG
Free Email Extractor....
Put Interactive Python Anywhere on the Web
Customize the code below and Share!
<> main.py
1 + def add_polynomials (degreel, coefficients1, degree2, coefficients2):
max_degree= max(degreel, degree2)
2
3
8 # Execution Trace
11
Remove Audio fro...
S
(1) Langmia Hustle T...
12
9 degree_1= int(input ("Enter the degree of the first polynomial: "))
14
LachoFit (@lachofit)...
coefficients1 = coefficients1 + [0] * (max_degree - degree1)
coefficients2 = coefficients2 + [0]* (max_degree
degree2)
result
[coeff1 coeff2 for coeff1, coeff2 in zip (coefficients1, coefficient
return max_degree, result
10 coefficients_1 = [float(input (f"Enter coefficient for x^{degree_1 - i}: ")) for i
++ B
degree 2 int (input("Enter
degree of second polynomial: "))
13 coefficients_2 = [float (input (f"Enter coefficient for x^{degree_2 i): ")) for i
Homeworki
15 degree_result, coefficients_result = add_polynomials (degree_1, coefficients_1, deg
16 print (f"The result of addition is: {coefficients_result}")
Transcribed Image Text:← → C Fiverr / cheryl_anna... trinket trinket.io/python Privacy Terms fi Fiverr / Inbox 4 5 6 7 CONTENEG Free Email Extractor.... Put Interactive Python Anywhere on the Web Customize the code below and Share! <> main.py 1 + def add_polynomials (degreel, coefficients1, degree2, coefficients2): max_degree= max(degreel, degree2) 2 3 8 # Execution Trace 11 Remove Audio fro... S (1) Langmia Hustle T... 12 9 degree_1= int(input ("Enter the degree of the first polynomial: ")) 14 LachoFit (@lachofit)... coefficients1 = coefficients1 + [0] * (max_degree - degree1) coefficients2 = coefficients2 + [0]* (max_degree degree2) result [coeff1 coeff2 for coeff1, coeff2 in zip (coefficients1, coefficient return max_degree, result 10 coefficients_1 = [float(input (f"Enter coefficient for x^{degree_1 - i}: ")) for i ++ B degree 2 int (input("Enter degree of second polynomial: ")) 13 coefficients_2 = [float (input (f"Enter coefficient for x^{degree_2 i): ")) for i Homeworki 15 degree_result, coefficients_result = add_polynomials (degree_1, coefficients_1, deg 16 print (f"The result of addition is: {coefficients_result}")
Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education