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:
![b. Given the detailed control flow graph (CFG) of the Java code, identify and write three of the paths](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/answers/2023/10/65205b07da3c8_27165205b07d4c30.jpg)
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,6-0, 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,6-0, 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 billion-dollar 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
-
Should they only consider specialty food outlets? Tourist destination shops?
-
(The effect of different lease arrangements on the financial statements, LO 3, 4, 5) Kashabowie Properties Ltd. (Kashabowie) owns and operates several commercial real estate properties in Halifax. On...
-
Q5 What is the difference between an enterprise DBMS and a personal DBMS?
-
A travelling production of Grease performs 120 shows each year. The average show sells 1,000 tickets at $65 per ticket. The show has a cast of 45, each earning an average of $320 per show. The cast...
-
Gallatin Carpet Cleaning is a small, family-owned business operating out of Bozeman, Montana. For its services, the company has always charged a flat fee per hundred square feet of carpet cleaned....
-
Ewing Natural Gas is a large energy company with headquarters in Dallas, Texas. The company offers a wide variety of energy products and has annual revenues of approximately $50 billion. Because of...
-
You should consider sending your manager a weekly update, usually on a Friday or Monday, which includes these 3 fundamental elements: The names of teammates not performing as well as you, things you d
-
Imagine that you are a conflict resolution and negotiation consultant who has been hired to assist a company with some specific needs. Ms. Jennifer Garcia is the human resources supervisor at this...
-
A number generator sequences through numbers, 0, 1, 3, and 6. After 6, it goes back to O and continues the same counting sequence. A 3-bit binary number ABC is used to represent the numbers, whereby...
-
Find the derivative of f(x) = x cos x f'(x) = Submit answer
-
Describe what XLSTAT is and describe two of its features 7. Describe what SPSS Statistics are and describe two features. 8. How do you calculate the lifetime value of a customer? 9. What do...
-
Consider the value of the trigonometric function sin (7) 6 It's value is Click for List Now find the exact value of that trigonometric function. sin () 6
-
Wha
-
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 10-o 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...
-
Animal-assisted therapy for heart patients. A study was presented at the American Heart Association Conference (Nov. 2005) to gauge whether animal-assisted therapy can improve the physiological...
-
Land purchase decision. A buyer for a lumber company must decide whether to buy a piece of land containing 5,000 pine trees. If 1,000 of the trees are at least 40 feet tall, the buyer will purchase...
-
For a quantitative data set, explain the a. 20th percentile. b. middle quartile. c. population z-score for a measurement.
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App