Reference no: EM131390747
Assignment- Coding Problems:
1. Matlab. Complete the quadratic equation solver yournameQuadEqn.m. See the comments at the top for specific directions, but the main idea is to avoid loss of significance by re-writing one of roots
r1 = {-b + √(b2 - 4ac)} / 2a, r1 = {-b - √(b2 - 4ac)} / 2a.
• The formula for the root r1 has potential loss of significance when b >0 and b2 >4ac; The second root r2 is best left as is.
• The formula for the root r2 has potential loss of significance when b <0 and b2 >4ac. The first r1 is best left as is.
2. Write a C program for estimating adding numbers in a 2D grid. See the file yournameGridSum.cto get started. This program will exhibit the effect of cumulative rounding error (caused by adding a lot small values.) Consider an N × N grid (we'll use N = 5000) dividing up the unit square into smaller squares. Therefore each subsquare has width w = 1/N. Let (xi,yj) denote the midpoint of the square in column i, row j.
Note that
xi = (i- 0.5) ∗ w
Your job is to compute the double sum
For N large, the value of S should approach 2. You will compute S in two different ways: I. Summing up the numbers 1 by 1 in a nested for loop.
PSEUDOCODE
Initialize: width=1/N; sum1=0;
for loop: row=1 to N for loop: col=1 to N x = (col -0.5)* width y = (row - 0.5)*width sum1 = sum1 + (x*x + y*y)
end of inner loop
end of outer loop finalResult1= 3*width*width*sum1
II. Sum all the number in a row, then add to overall sum.
PSEUDOCODE
Initialize: sum2=0;
for loop: row=1 to N
rowSum=0; y= (row - 0.5)*width for loop: col=1 to N x = (col -0.5)*width rowSum = rowSum + (x*x + y*y)
end of inner loop sum2=sum2+ rowSum
end of outer loop finalResult2= 3*width*width*sum2.
Explain whether sears is correct in given contention
: Sears contends the order is too broad, because it covers appliances other than dishwashers and includes ‘‘performance claims'' as well. Explain whether Sears is correct.
|
What type of rule may the cpsc issue for atvs
: According to CPSC staff, children under the age of sixteen accounted for roughly half the deaths and injuries associated with this product. What type of rule, if any, may the CPSC issue for ATVs?
|
Explain whether colgate has engaged in unfair trade practice
: Colgate defended on the ground that the consumer was merely being shown a representation of the actual test.- Explain whether Colgate has engaged in an unfair or deceptive trade practice.
|
Find maximum acceleration of the center of the cylinder
: A 30-lb uniform cylinder can roll without sliding on a 15°-incline. A belt is attached to the rim of the cylinder, and a spring holds the cylinder at rest in the position shown.
|
Write c program for estimating adding numbers in two-d grid
: Write a C program for estimating adding numbers in a 2D grid. See the file yournameGridSum.cto get started. This program will exhibit the effect of cumulative rounding error (caused by adding a lot small values.).
|
Is robert entitled to the information
: Robert demands to know why the loan was rejected, but Northern refuses to divulge the information, arguing that it is privileged. Is Robert entitled to the information?
|
Running case study dirty pools
: 1. would off-the-iob training be an appropriate and effective way to train pool operat oo? and their employees? Explain your answer.2. what off.theiob training methods would you recommend to train pool operaton and their employees? Review each of the..
|
How much can visa collect from thomas
: Thomas does not discover that he has lost his wallet until the following day, when he promptly notifies his Visa bank. How much can Visa collect from Thomas?
|
Will visa prevail in given contention and why
: Brown's refuses to repair or replace it or to credit Francie's account. Francie therefore refuses to pay Visa for the television. Visa brings a suit against Francie. Will Visa prevail? Why?
|