Using the source code below: public int Fun1(int x, int y){ k = 0; while (x...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Using the source code below: public int Fun1(int x, int y){ k = 0; while (x <= 10 && k < 10){ if (x%2!= 0){ k=k+y; k = k - 2; } X = x + 1; k = x + k; } if (x < 0){ X = Y; k=k+x; } return k; } 1. Draw a data flow graph for the code. 2. Identify all def clear paths in your graph. 3. Identify all simple paths in your graph. 5. Identify at least one loop free path in your graph. 6. Identify all p-uses/Some c-uses in your graph. Using the source code below: public int Fun1(int x, int y){ k = 0; while (x <= 10 && k < 10){ if (x%2!= 0){ k=k+y; k = k - 2; } X = x + 1; k = x + k; } if (x < 0){ X = Y; k=k+x; } return k; } 1. Draw a data flow graph for the code. 2. Identify all def clear paths in your graph. 3. Identify all simple paths in your graph. 5. Identify at least one loop free path in your graph. 6. Identify all p-uses/Some c-uses in your graph.
Expert Answer:
Answer rating: 100% (QA)
Step 1 a Flow graph for the method Fun In this part we need to represent the method Fun as a flow graph labeling the nodes starting with A and appropriately connecting them Heres the flow graph A B C ... View the full answer
Related Book For
Building Java Programs A Back To Basics Approach
ISBN: 9780135471944
5th Edition
Authors: Stuart Reges, Marty Stepp
Posted Date:
Students also viewed these programming questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
(a) Explain how a limit worth may be tended to at run-time, both in a syntaxtree middle person and in collected code. What is the importance word "settled" already? [3 marks] (b) Give a model program...
-
ttth Suppose that the sequence of bags {Bn | n N} is recursively enumerated by the computable function e(n, x) = fn(x), [7 marks] Hence prove that the set of all recursive bags cannot be recursively...
-
Orca Industries is considering the purchase of Shark Manufacturing. Shark is currently a supplier for Orca and the acquisition would allow Orca to better control its material supply. The current cash...
-
A particle leaves the origin with an initial velocity v(vector) = (2.40 m/s) x, and moves with constant acceleration a(vector) = ( 1.90 m/s 2 ) x + (3.20 m/s 2 ) y. (a) How far does the particle move...
-
Create a useful dashboard for the data in the Excel file Restaurant Sales. Use appropriate charts and layouts and other visualization tools that help to convey the information. Explain why you chose...
-
True or False: For personal investment decision making, rates of return are used more frequently than present worth.
-
Assume that a resource used by activities e, f, g, and h in the figure below is scarce. To which activity would you assign the resource, based on the following rules? a. Minimum slack b. Most...
-
(a) Use the method of direct Integration to find the solution of x2. (b) (i) dy -4x=6. (5%) dx Verify that y = ex, y = e3x and y = Aex + Be -3x (A and B are constants) are - 6y= 0. (10 %) solutions...
-
On December 31, 2020, Concord Company signed a $1,035,300 note to Marigold Bank. The market interest rate at that time was 11%. The stated interest rate on the note was 9%, payable annually. The note...
-
Consider organizational citizenship behaviors (OCB). How can you use the Theory of Reasoned Action to explain employees' lack of willingness to perform OCBs? Be specific when identifying perceptions...
-
Net income = 5.00 Dividends = 1.00 Beginning book value of equity = 30.00 Required rate of return on equity = 11 percent Calculate residual income.
-
5. Given the function g(x) = -x + 2x, find the interval(s) when g is concave down and increasing at the same time. 6. Given the function h(x) = x + x-5x, find the interval(s) when h is concave up and...
-
How much do you pay for a zero coupon government bond that has a term of 30 years, an interest rate of 10 %, and a par value of $1000.
-
ABC Company has projected Sales of $2402 in January. The sales are expected to grow by 13%each month. ABC's collection schedule is as follows: ABC collects 82 percent of its sales in the month of...
-
The P/E ratio for Mailbu Boats (MBUU) is 13.24 and the expected growth rate is 16%. If the plowback ratio is 80% what is the current required rate of return (market capitalization rate) of the stock?
-
Determine the horizontal and vertical components of reaction at the pin A and the reaction of the rocker B on the beam. Solution must include an FBD. 4 kN B A 30 6 m -2 m
-
Describe a job you have had in the past or a job you are very familiar with. Indicate the negative aspects of the job and how it could be improved with current human resource management techniques.
-
What is the output of the following program? (You may wish to draw a structure diagram first.) public class Strange { public static void first () { System.out.println ("Inside first method"); public...
-
Write a method called compressDuplicates that accepts a stack of integers as a parameter and that replaces each sequence of duplicates with a pair of values: a count of the number of duplicates,...
-
How many roots can a tree have? Does a tree have more branches or leaves?
-
An April 2014 study by researchers at University College London found that people who ate seven or more portions of fruits and vegetables a day had a \(42 \%\) lower risk of death at any point in...
-
The consumption of alcohol is illegal for Afghan citizens, but the government does allow the sale of alcohol under licence to foreigners. Use a diagram to show how such a prohibition would affect the...
-
Suppose that the demand curve for wheat is \(Q=100-10 p\) and the supply curve is \(Q=10 p\). The government imposes a specific tax of \(t=1\) per unit. a. How do the equilibrium price and quantity...
Study smarter with the SolutionInn App