Write a Python class that inputs a polynomial in standard algebraic notation and outputs the first derivative of that polynomial. Both the inputted polynomial and its derivative should be represented as strings.

Answers

Answer 1

Answer:Python code: This will work for equations that have "+" symbol .If you want to change the code to work for "-" also then change the code accordingly. import re def readEquation(eq): terms = eq.s

Explanation:


Related Questions

You will write code to manipulate strings using pointers but without using the string handling functions in string.h. Do not include string.h in your code. You will not get any points unless you use pointers throughout both parts.
You will read in two strings from a file cp4in_1.txt at a time (there will be 2n strings, and you will read them until EOF) and then do the following. You alternately take characters from the two strings and string them together and create a new string which you will store in a new string variable. You may assume that each string is no more than 20 characters long (not including the null terminator), but can be far less. You must use pointers. You may store each string in an array, but are not allowed to treat the string as a character array in the sense that you may not have statements like c[i] = a[i], but rather *c *a is allowed. You will not get any points unless you use pointers.
Example:
Input file output file
ABCDE APBQCRDSETFG
PQRSTFG arrow abcdefghijklmnopgrstuvwxyz
acegikmoqsuwyz
bdfhjlnprtvx

Answers

Solution :

#include [tex]$< \text{stdio.h} >$[/tex]

#include [tex]$< \text{stdlib.h} >$[/tex]

int [tex]$\text{main}()$[/tex]

{

[tex]$\text{FILE}$[/tex] *fp;

[tex]$\text{fp}$[/tex]=fopen("cp4in_1.txt","r");

char ch;

//while(1)

//{

while(!feof(fp))

{

char *[tex]$\text{s1}$[/tex],*[tex]$\text{s2}$[/tex],*[tex]$\text{s3}$[/tex];

[tex]$\text{s1}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$20$[/tex] * [tex]$\text{sizeof}$[/tex](char));

[tex]$\text{s2}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$20$[/tex] * [tex]$\text{sizeof}$[/tex](char));

[tex]$\text{s3}$[/tex] = (char*) [tex]$\text{malloc}$[/tex]([tex]$40$[/tex] * [tex]$\text{sizeof}$[/tex](char));

[tex]$\text{int i}$[/tex]=0,j=0,x,y;

while(1)

{

ch=getc(fp);

if(ch=='\n')

break;

*(s1+i)=ch;

i++;

}

while(1)

{

ch=getc(fp);

if(ch=='\n')

break;

*(s2+j)=ch;

j++;

}

for(x=0;x<i;x++)

{

*(s3+x)=*(s1+x);

}

for(y=0;y<j;x++,y++)

{

*(s3+x)=*(s2+y);

}

for(x=0;x<i+j;x++)

{

printf("%c",*(s3+x));

}

printf("\n");

getc(fp);

}

}

Parts of a computer software

Answers

Answer:

I think application software

utility software

networking software

Other Questions
Determine the intercepts of the line? Lens Junction sells lenses for $44 each and is estimating sales of 16,000 units in January and 17,000 in February. Each lens consists of 2 pounds of silicon costing $2.50 per pound, 3 oz of solution costing $3 per ounce, and 15 minutes of direct labor at a labor rate of $18 per hour. Desired inventory levels are: Jan. 31 Feb. 28 Mar. 31 Beginning inventory Finished goods 4,300 4,800 4,900 Direct materials: silicon 8,300 9,200 9,000 Direct materials: solution 11,000 12,200 12,900 what is the circumfrence of a circle with a radius of 4 inches. Use 3.14 for pi. through: (-5, 4), slope =-3/5 If Houston is six hours behind London, what time would it be in Houston if it were 9 p.m. in London? Math help help please When setting your schedule, it is sometimes necessary to tell people "No." Please select the best answer from the choices provided. t or f Use the following numbers, 4, 30, and 21 to create an equation equal to 1. You may only use each number once. You can use any operation you want to. Emerson swims 1/2 a miles every 1/4 of an hour. How far can she swim in one hour? (Complex fractions) Given that 1 = $1.62b)a) How much is 650 in $?b) How much is $405 in ? Jamaal wants to improve his chances of understanding certain content in his science class so that he can do well on an upcoming test. To monitor his understanding of the material, he decides to write down everything that he already knows about the content that will be tested. He also puts into place a plan to address his weaknesses in his understanding of certain scientific concepts. What is most likely to happen as a result of Jamaal following these steps? He will increase his understanding of content in other subject areas. He will see an improvement on his test score for the upcoming science test. His teacher will allow him to retake his test if he does poorly. He will receive a lecture from his teacher for performing poorly on his science tests. help plz plz plz ill give brain True or False: There are many different types of leukocytes.TrueFalse ------------------------- Can someone please help me with this question the instructions are to use a calculator to find the perimeter (the solid lines and curves) of each figure. The perimeter of each semicircle can be found by using the equation 1/2 pi d (the place where I put the words pi has the pi symbol, and d is just a variable. Also use 3.14 as pi, and the top part is cut off a little bit, but it still counts as a full semi circle. Please help me. what do we call goods that are no longer available once you have used them?? Question 1717. Find the scale factor that was used in the dilation shown. Whoever finds the name of this song first gets brainliest.Vengo desde el pasado y permanezco en el presenteMe tiene muy pendiente, ms que a los pretendientesPorque conmigo siente lo que con otro no sienteLa trato diferente, porque soy indiferenteY ahora de nuevo ella se quiere lucirMe pide ms, dice que quiere repetirDe nuevo en mi cama, conmigo quiere dormirEntre gemidos dice que le gusta hacerlo asY ahora de nuevo ella se trepa encima 'e mMe pide ms y dice que quiere repetirDe nuevo en mi cama, conmigo quiere dormirEntre gemidos dice que le gusta hacerlo asT eres mi pasado y presenteSiempre est' en mi menteTu futuro, beb, danza kuduroMe es un perjurio hacindolo en lo oscuroYo te torturo y por dentro te fracturoY haciendo el amor no me deja morirTo' los das se quiere venirMi beb que hasta un hijo me quiere parir (eh-eh)Hacemos threesomes y otra beb ella quiere aadirYa en un pasado le hicieron sufrirElla siempre me pone esa' nalga' a aplaudirBeb bilame, manpulameY en la prxima vida hazme tuyo otra vezY ahora de nuevo ella se quiere lucirMe pide ms, dice que quiere repetirDe nuevo en mi cama, conmigo quiere dormirEntre gemidos dice que le gusta hacerlo asY ahora de nuevo ella se trepa encima de mMe pide ms, dice que quiere repetirDe nuevo en mi cama, conmigo quiere dormirEntre gemidos dice que le gusta hacerlo asElla quiere volverme a ver,El tiempo retrocederNo quiere amores conmigo, quiere que se lo vuelva hacerQuiere verse a mi nivel, se pone el AP y la CartierLo hacemos en el G4 y en el Phantom lo hacemos tambinMam, yo te doy la bienvenida a mi camaUn placer aqu tenerte, seorita, cmo vas?Si es prohibido es mejor, la adrenalina vale msSi l te llama, t le dice que conmigo t te vasVengo desde el pasado y permanezco en el presenteMe tiene muy pendiente, ms que a los pretendientesPorque conmigo siente lo que con otro no sienteLa trato diferente, porque soy indiferenteY ahora de nuevo ella se quiere lucirMe pide ms, dice que quiere repetirDe nuevo en mi cama, conmigo quiere dormirEntre gemidos dice que le gusta hacerlo asY ahora de nuevo ella se trepa encima 'e mMe pide ms y dice que quiere repetirDe nuevo en mi cama, conmigo quiere dormirEntre gemidos dice que le gusta hacerlo asChris JedayGaby MusicAnuelOzunaReal Hasta La Muerte, oi'te beb?Brrr What were six accomplishments of the people of Mesopotamia?steam powermultiplication and divisionmetal-tipped plowweights and measureswheelwater purificationgood roadswritten languages me pueden ayudar a poner los adjetivos