n=22 s=0 a=1/n i=0 while(s S=s+a --->i=i+1 --->if(i==n){ $1=s} end In the exact arithmetic, the while...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
n=22 s=0 a=1/n i=0 while(s<1.0) --->S=s+a --->i=i+1 --->if(i==n){ $1=s} end In the exact arithmetic, the while loop should terminate at i = n and return the value 1. In your calculation, what are the values of i, s and s1 when the while loop terminates? Enter your answers to at least the fifth decimal. 2 Write a program to implement the following code using double precision floating point arithmetic 8 = s1 = n=22 s=0 a=1/n i=0 while(s<1.0) --->S=s+a --->i=i+1 --->if(i==n){ $1=s} end In the exact arithmetic, the while loop should terminate at i = n and return the value 1. In your calculation, what are the values of i, s and s1 when the while loop terminates? Enter your answers to at least the fifth decimal. 2 Write a program to implement the following code using double precision floating point arithmetic 8 = s1 =
Expert Answer:
Answer rating: 100% (QA)
Solution for the above question is Therefore this is the required answer f... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
QUIZ... Let D be a poset and let f : D D be a monotone function. (i) Give the definition of the least pre-fixed point, fix (f), of f. Show that fix (f) is a fixed point of f. [5 marks] (ii) Show that...
-
A 15.00 g metal sphere was found to have a diameter of 1.85 cm. The volume of a sphere is V = (4/3)r. Calculate the density of the sphere and assuming that the sphere is made out of one of the...
-
1. If you decrease the interest rate for an investment by 10%, will the future value decrease by 10%? 2. If interest is compounded semiannually, will the effective rate be higher or lower than the...
-
The following report was prepared for evaluating the performance of the plant manager of Miss-Take Inc. Evaluate and correct thisreport. Miss-Take Inc. Manufacturing Costs For the Quarter Ended March...
-
A capacitor initially has a charge of magnitude \(q\) on each plate. When a dielectric is inserted between the plates, the bound surface charge on the two dielectric surfaces facing the plates has a...
-
The executor of Rose Shields estate listed the following properties (at fair value): Cash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . $300,000 Life insurance...
-
1. An unpolarized light beam is incident on the polarizes of a polarization experiment and the intensity of light beam emerging from the analyzer is measured as 100 Lumens. Now, if the analyzer is...
-
Question using the case study: Explain the different ways of financing Netflix's expansion into gaming, their advantages and drawbacks, and the impact of Netflix's expansion into gaming on Netflix's...
-
BRAND EQUITY Ariel Research, a market research company, had just collected a large dataset from a random sample of Canadian consumers. This data set contained 125,000 entries on different brands of...
-
An ice dancer with her arms stretched out starts into a spin with an angular velocity of 1.00 rad/s. Her moment of inertia with her arms stretched out is 2.48 kg m2. What is the increase in her...
-
Consider a situation in which the government is considering whether to provide universal healthcare coverage, which would mean that workers would no longer need to keep their current job to maintain...
-
3 . 1 0 3 . 1 0 A Ge sample is doped with 1 0^ 1 4 / 1 0 1 4 / cm 3 3 As atoms / / cm 3 . 3 . What will be the equi - librium hole concentration? What is the relative position of Fermi level w . . r...
-
A B C D E F G H I J 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 A) On June 1, the 4-month interest rates in Switzerland and the United States were, respectively, 2% and 5% per annum with...
-
There is a medical test for a virus. The test is 95% accurate (i.e., it indicates positive 95% of the time when the individual has actually the virus, as it also indicates negative 95% of the time...
-
Calculate the Lagrange polynomial P 2 (x) for the values (1.00) = 1.0000, (1.02) = 0.9888, (1.04) = 0.9784 of the gamma function [(24) in App. A3.1] and from it approximations of (1.01) and (1.03).
-
At the end of April, Hernandez Company had a balance of $37,910 in the vacation benefits payable account. During May, employees earned an additional $2,790 in vacation benefits, but some employees...
-
Karen Kluster opened Lube and Wash on January 1, 2016. The business is subject to FICA taxes. At the end of the first quarter of 2016, Kluster, as president of the company, must file Form 941,...
-
Why must some employers file Form 1096?
-
For the given periodic process execution times and periods (P1 has the highest priority), show how much CPU time of higher-priority processes will be required during one period of each of the...
-
For the periodic processes shown below: a. Schedule the processes using an RMS policy. b. Schedule the processes using an EDF policy. In each case, compute the schedule for an interval equal to the...
-
For the given set of periodic processes, all of which share the same deadline of 12: a. Schedule the processes for the given arrival times using standard ratemonotonic scheduling (no data...
Study smarter with the SolutionInn App