Question: Design a function that utilizes Newton's method for calculating the cube root of a given number. ; contract: calcCubeRoot: number(x) number 2. (25 points)

Design a function that utilizes Newton's method for calculating the cube root of a given number. ; contract:

Design a function that utilizes Newton's method for calculating the cube root of a given number. ; contract: calcCubeRoot: number(x) number 2. (25 points) Design a function that applies binary addition for given two binary numbers. For example, z = 0010 (= 2 in 10-base system) and y = 1010 (= 10), then x + y = 1100 (= 12). ; contract: addBinaryNumbers: string(x) string(y) string 3. (25 points) Design a function that finds the smallest root of a quadratic equation. For example, for the given function x-3x - 4, the smallest root is -1. ; contract: calcSmallest Root: number(coef1) number(coef2) number(coef3) num ; coef (coefficient) parameters are given in order such that coef1 corresponds to the coefficient of , coef2 corresponds to x and coef3 is for x 4. (25 points) Design a function that finds the first occurrence index of the given pattern in the given sentence. For example, assume that the query is "world" and the sentence is "Hello world", then the function returns 6. If any occurrence of the pattern is not found, then the function returns -1 indicating that the pattern does not exist in the given sentence. ; contract: findPatternIndex: string(sentence) string(query) number

Step by Step Solution

3.42 Rating (149 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!