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,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
-
Youngs double-slit experiment is performed with 589-nm light and a distance of 2.00 m between the slits and the screen. The tenth interference minimum is observed 7.26 mm from the central maximum....
-
Which of the following statements are true about molecular markers? A. All molecular markers are segments of DNA that carry specific genes. B. A molecular marker is a segment of DNA that is found at...
-
Refer to the sample statistics from Exercise 5 and determine whether any of the house prices below are unusual. Explain your reasoning. (a) $225,000 (b) $80,000 (c) $200,000 (d) $147,000 Data from...
-
Provide examples of (a) intrasender role conflict, (b) intersender role conflict, (c) interrole conflict, and (d) personrole conflict that you have experienced.
-
Simplify the expression 5 4 4 z 2 + 9 9 z 2
-
Prepare a skeleton statement of revenues, expenditures, and changes in fund balances using the headings in Illustration 2-11 (e.g., Revenues, Expenditures, and Excess (Deficiency) of Revenues over...
-
Ques1- Who is the target market of taj falaknuma palace? And their demographics such as age, income bracket, generational etc. and What type of traveller comes to taj falaknuma palace (tourist,...
-
As a rule of thumb, what assets should be used FIRST during retirement so as to minimize the tax liability for spouses/common-law partners? a) non-registered assets of the higher income spouse or...
-
Question The digital microwave radio system shown in Figure 2 operates in... The digital microwave radio system shown in Figure 2 operates in the 18GHz radio frequency band and provides 2x2 Mbps...
-
According to the Adams v. Krueger case in our textbook, the doctor's nurse practitioner (NP) diagnosed plaintiff with genital herpes when, in fact, she had a yeast infection. The doctor failed to...
-
Darla has an annual income of $120 that she spends on movies, at $10 per show, and All Other Goods. Suppose a movie theatre offers to sell her a pass that will allow her to see any amount of movies...
-
Writ the C++ code of queue which is performed multiple task which are given below and performed all task by using Arrays. I.En-queue values 10, 20, 5 , 50, 40, 60, 45 II.De-queue values 45, 60, and...
-
Given Differential equation isx2y"-3xy'+5y=xs(logx). xy"-3xy'+5y=x2sin(logx).
-
You deposit $10,000 in a savings account that earns 7.5% simple interest per year. What is the minimum number of years you must wait to double your balance? Suppose instead that you deposit the...
-
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...
-
A university is deciding between two meal plans. One plan charges a fixed fee of \($600\) per semester and allows students to eat as much as they want. The other plan charges a fee based on the...
-
Evaluate this statement: You are a natural athlete, an attractive person who learns easily and communicates well. Clearly, you can do everything better than your friends and acquaintances. As a...
-
In elementary school and through middle school, most students have the same teacher throughout the day and for the entire school year. Then, beginning in high school, different subjects are taught by...
Study smarter with the SolutionInn App