b. Given the detailed control flow graph (CFG) of the Java code, identify and write three...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
b. Given the detailed control flow graph (CFG) of the Java code, identify and write three of the paths through the graph in table form and then show (also in table form) the path predicate for one of the paths in the control flow graph. [4] public static double ReturnAverage (int value [], int AS, int MIN, int MAX) /* Function: ReturnAverage Computes the average of all those numbers in the input array in the positive. range [MIN, MAX]. The maximum size of the array is AS. But, the array size could be smaller than AS in which case the end of input is represented by 999. int i, ti, tv, sum; double av; i = 0; ti = 0; tv = 0; sum = 0; while (ti<AS && value [i]!=999) { ti++; if (value [i] >= MIN & & value [i]<= MAX) { } i++; tv++; sum sum + value [i]; } if (tv > 0) av (double) sum/tv; else av = (double) 999; return (av); 11 av (double)999 IV> 0 10 13 Initialize value(1, AS MIN, MAX return(av) i=0,60, tv = 0, sum=0 av = (doublcham/tv 12 <AS F 3 2 valuc[i] 999T i++ li++ valucli)MIN valuci] MA IVET sum sum + valuc[i] b. Given the detailed control flow graph (CFG) of the Java code, identify and write three of the paths through the graph in table form and then show (also in table form) the path predicate for one of the paths in the control flow graph. [4] public static double ReturnAverage (int value [], int AS, int MIN, int MAX) /* Function: ReturnAverage Computes the average of all those numbers in the input array in the positive. range [MIN, MAX]. The maximum size of the array is AS. But, the array size could be smaller than AS in which case the end of input is represented by 999. int i, ti, tv, sum; double av; i = 0; ti = 0; tv = 0; sum = 0; while (ti<AS && value [i]!=999) { ti++; if (value [i] >= MIN & & value [i]<= MAX) { } i++; tv++; sum sum + value [i]; } if (tv > 0) av (double) sum/tv; else av = (double) 999; return (av); 11 av (double)999 IV> 0 10 13 Initialize value(1, AS MIN, MAX return(av) i=0,60, tv = 0, sum=0 av = (doublcham/tv 12 <AS F 3 2 valuc[i] 999T i++ li++ valucli)MIN valuci] MA IVET sum sum + valuc[i]
Expert Answer:
Answer rating: 100% (QA)
This control flow graph represents the flow of the ReturnAverage Java function which computes the av... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions

Suppose at December 31 of a recent year, the following information (in thousands) was available for sunglasses manufacturer Oakley, Inc.: ending inventory $130,200, beginning inventory $100,800, cost...

Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...

The Crazy Eddie fraud may appear smaller and gentler than the massive billiondollar frauds exposed in recent times, such as Bernie Madoffs Ponzi scheme, frauds in the subprime mortgage market, the...

Solve each system. If a system is inconsistent or has dependent equations, say so. 5x + 2y = 4 6x + 3y = 6

Prove that the centroidal polar moment of inertia of a given area A cannot be smaller than A2/2.

Marcia Stubern is planning for her golden years. She will retire in 20 years at which time she plans to begin withdrawing 60,000 annually. She is expected to live for 20 years following her...

How much energy is dissipated in the collision of Checkpoint 7.11? Data from Checkpoint 7.11 A 1000kg compact car and a \(2000\mathrm{kg}\) van, each traveling at \(25 \mathrm{~m} / \mathrm{s}\),...

Although it will fulfill her lifelong dream, Patricia is not confident that demand for her Tiny Trisha doll will exceed the breakeven point computed in Problem 65. If she chooses a less appealing...

6. If the tangent to the curve y = x at the point P(t, t) meets the curve again at Q, then the ordinate of the point which divides PQ internally in the ratio 1:2 is: (a) 0 7. (b)t The system of...

Refer to Exercise 29 of Section 4.2. For what values of h will a sensitivity analysis on the effect of a change of h pounds of peat be valid? In exercise A lawn and garden store creates three...

The convexity of an Nperiod zero coupon bond is 37.735 semiannual periods. The N period spot rate is 5.5% in semiannual terms. Which of these statements is true: The face value must be 1000 The...

9. A 10year loan with an annual effective interest rate of 5% per year for X is taken out by Joe. Joe fully repays the loan using the following schedule of payments. (i) (ii) (iii) 100 at the end of...

Explain bank runs. Discuss the measures that the U.S. took to address the bank runs of the Great Depression, and the implications of those actions.

Do you agree or disagree with the framework previously built upon MetaLeadership effectiveness and the response to COVID19 based on cyber technology and distribution of the information from 2020?...

Did the Decision Tech Team go through all four stages of team development? If yes, discuss the effectiveness of Kathryn s approach to helping the team move through each stage. Give specific examples...

Various tools are available for developing and managing an auditing project plan and associated elements of an audit. Which tool is designed to enable an auditor to track audit deficiencies and areas...

2. An opentopped freight car of mass 10000 kg is coasting without friction along a level track. It is raining very hard with the rain falling vertically downward. The car is originally empty and...

Suppose the concentration of glucose inside a cell is 0.1 mm and the cell is suspended in a glucose solution of 0.01 mm. a. What would be the free energy change involved in transporting 10o mole of...

Professor Patricia (Patty) Pate is retired from the PalmSprings Culinary Arts Academy (PSCAA). She is a single taxpayer and is 68 years old. Patty lives at 98 Colander Street, Henderson, NV 89052....

Diane is a single taxpayer who qualifies for the earned income credit. Diane has two qualifying children who are 3 and 5 years old. During 2012, Diane's wages are $17,100 and she receives dividend...

Marty is a sales consultant. Marty incurs the following expenses related to entertainment of his clients in 2012: Dues to a country club......................................................$4,500...

What important precedents were set by the Griggs v. Duke Power Company case? The Albemarle v. Moody case?

From a practical point of view, why is it important for all managers and future managers to have a good command of human resource management concepts and techniques?

Explain what HR management is and how it relates to the management process.
Study smarter with the SolutionInn App