Given the following sample code written in Java programming language: double getGrossPay (double rate, double hrwkd)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Given the following sample code written in Java programming language: double getGrossPay (double rate, double hrwkd) { 01 02 03 04 05 06 07 OOOO 08 09 10 11 TT HNM 12 13 14 15 16 1441 4567OHi1000 OH 17 18 19 20 21 WWNNNNNNNNN 22 23 24 25 26 27 28 29 30 31 } final double OTR = 1.5; double reghr = 0.0, regpay = 0.0; double othr= 0.0, otpay = 0.0; double holhr = 0.0, holpay. = 0.0; double grosspay = 0.0; if (hrwkd <= 0) grosspay = 0.0; else { int whole = (int) hrwkd; double frac = hrwkd whole; frac = 100* (Math.ceil (frac* 4) /4) ; hrwkd whole + frac/100; reghr = 0.0; othr= 0.0; reghr= 0.0; if (hrwkd> 40) { reghr = 40; othr = hrwkd - 40; } else { reghr hrwkd; othr = 0; } otpay other * OTR * rate; regpay reghr* rate; grosspay = regsPay + otpay; } return grosspay; a. Draw the data flow diagram. Find all the anomalies along with their type in the above code. b. Find an infeasible path (if exists) in the data flow graph for the getGrossPay method. c. Give all the Def and c-use() Sets of Nodes in the above data flow graph in tabular form. d. Give Predicates and p-use() Set of Edges in the above data flow graph in tabular form. e. By referring to the data flow graph obtained above, find a set of complete paths satisfying the all-defs selection criterion with respect to variable hrwkd. Given the following sample code written in Java programming language: double getGrossPay (double rate, double hrwkd) { 01 02 03 04 05 06 07 OOOO 08 09 10 11 TT HNM 12 13 14 15 16 1441 4567OHi1000 OH 17 18 19 20 21 WWNNNNNNNNN 22 23 24 25 26 27 28 29 30 31 } final double OTR = 1.5; double reghr = 0.0, regpay = 0.0; double othr= 0.0, otpay = 0.0; double holhr = 0.0, holpay. = 0.0; double grosspay = 0.0; if (hrwkd <= 0) grosspay = 0.0; else { int whole = (int) hrwkd; double frac = hrwkd whole; frac = 100* (Math.ceil (frac* 4) /4) ; hrwkd whole + frac/100; reghr = 0.0; othr= 0.0; reghr= 0.0; if (hrwkd> 40) { reghr = 40; othr = hrwkd - 40; } else { reghr hrwkd; othr = 0; } otpay other * OTR * rate; regpay reghr* rate; grosspay = regsPay + otpay; } return grosspay; a. Draw the data flow diagram. Find all the anomalies along with their type in the above code. b. Find an infeasible path (if exists) in the data flow graph for the getGrossPay method. c. Give all the Def and c-use() Sets of Nodes in the above data flow graph in tabular form. d. Give Predicates and p-use() Set of Edges in the above data flow graph in tabular form. e. By referring to the data flow graph obtained above, find a set of complete paths satisfying the all-defs selection criterion with respect to variable hrwkd.
Expert Answer:
Answer rating: 100% (QA)
Check out the below explanation of th egiven question to get a clear idea about the question The giv... View the full answer
Related Book For
Elementary Statistics A Step By Step Approach
ISBN: 9780077665807
9th Edition
Authors: Allan G. Bluman
Posted Date:
Students also viewed these programming questions
-
Listing 4.3, GuessBirthday.java, gives a program for guessing a birthday. Write a JSF program that displays five sets of numbers, as shown in Figure 33.30a. After the user checks the appropriate...
-
From the Data Bank, select at least 30 subjects and construct a categorical distribution for their marital status. Draw a pie graph and describe briefly the findings. Data from Data Bank Appendix B...
-
Sketch the graph of the function and state its domain. f (x) = ln |x|
-
Why does the economic growth model predict that poor countries should catch up to rich countries in real GDP per capita? Have poor countries been catching up to rich countries?
-
In Exercise 9.65, suppose that (unknown to the dealers) the actual population proportion is really 0.35. If they use their estimated value ( 0.15) in determining the sample size and then conduct the...
-
Suppose we fit the model $\mathbf{y}=\mathbf{X}_{1} \boldsymbol{\beta}_{2}+\boldsymbol{\varepsilon}$ when the true model is actually given by $\mathbf{y}=\mathbf{X}_{1}...
-
Using the information from RE3-7, prepare Gold fingers closing entries for the current year. In RE3-7 Gold finger Corporation had account balances at the end of the current year as follows: sales...
-
Identify the problem statement for Apple bites back. Next, identify what will Apple need to do to maintain product innovation and customer loyalty? How has Apple developed extreme loyalty among...
-
Which federal act assists workers who are displaced through no fault of their own? Multiple Choice O O HIPAA FUTA SUTA ERISA
-
Write a function with the correct parameters to allow the following code to execute. The output is shown below if the function is written correctly. # Your working function will be here. list_one=...
-
You buy a pair of jeans at a store, at a sale price of $100. The store paid $40 to its supplier for the pair of jeans. What is the net income for the store?
-
It is important to remember that there are 2 sides to the budget. There is revenue and there are expenses. What happens when you misjudge the revenue portion?
-
192) Suppose the market demand for milk is Qd = 150 - 5P. Additionally, suppose that a dairy's variable costs are VC=2Q (where Q is the number of gallons of milk produced each day), its marginal cost...
-
Legal Bibliography Compilation (Mixed Source) Assignment Americans and injured one other person. He was found guilty of all charges and sentenced to death in federal court. He pleaded guilty to all...
-
List of Accounts Accounts Payable Accounts Receivable Advertising Expense Buildings Cash Equipment Gasoline Expense Insurance Expense Land Maintenance and Repairs Expense Miscellaneous Expense...
-
Poynting theorem states that: the total electromagnetic energy stored in a volume V is converted to heat and power flow across the surface bounded this volume, Prove [(E.J)dV = -d/ dt(U m) - S. da...
-
What did Lennox gain by integrating their WMS, TMS, and labor management systems?
-
From the Data Bank, select a random sample of at least 30 individuals, and test one or more of the following hypotheses by using the z test. Use = 0.05. a. For serum cholesterol, H 0 : = 220...
-
For Exercises follow these steps. a. State the hypotheses and identify the claim. b. Find the critical value(s). c. Compute the test value. d. Make the decision. e. Summarize the results. Use the...
-
For Exercises perform the following steps. a. Draw the scatter plot for the variables. b. Compute the value of the correlation coefficient. c. State the hypotheses. d. Test the significance of the...
-
A \(15.0-\mathrm{kg}\) block measures \(0.750 \mathrm{~m}\) top to bottom, and each horizontal face has an area of \(0.0125 \mathrm{~m}^{2}\). The block hangs, with its long central axis vertical,...
-
In a large vat that is initially empty, a solid aluminum cylinder hangs by an ideal spring. The cylinder is \(52.5 \mathrm{~mm}\) long and \(30.0 \mathrm{~mm}\) in diameter, and the spring is...
-
Suppose you increase the gauge pressure in the tires of your car by \(10 \%\). (a) How does the area of the tires in contact with a level road change? (b) If the gauge pressure in the tires is \(2.0...
Study smarter with the SolutionInn App