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:
![Given the following sample code written in Java programming language: double getGrossPay (double rate, double](https://dsd5zvtm8ll6.cloudfront.net/questions/2024/01/659bc3684fe6d_1704796876203.jpg)
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
-
Simon Company's year-end balance sheets follow. At December 31 Assets Current Year 1 Year Ago 2 Years Ago Cash $ 30,200 $ 35,500 Accounts receivable, net Merchandise inventory Prepaid expenses Plant...
-
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|
-
Don Masters and two of his colleagues are considering opening a law office in a large metropolitan area that would make inexpensive legal services available to those who could not otherwise afford...
-
At any moment, a RIP message may arrive at a router that runs RIP as the routing protocol. Does it mean that the RIP process should be running all the time?
-
Given that x is a random variable for which a Poisson probability distribution provides a good approximation, compute the following: LO9 a. P1x 12 when l = 1 b. P1x 12 when l = 2 c. P1x 12 when l...
-
Cooks Department Store advertises that it maintains in its store a barber shop managed by Hunter. Actually, Hunter is not an employee of the store but merely rents space in it. While shaving Jordon...
-
Cul de los siguientes factores influir en el ratio P/E de una empresa? A. La tasa de rendimiento requerida por los inversores B. Las oportunidades de inversin en firme C. Las condiciones generales...
-
Ethan is the leader of a team with N members. He has assigned an error score to each member in his team based on the bugs that he has found in that particular team member's task. Because the error...
-
What is finance? Briefly discuss how the study of finance is essential to business today. There are other areas of business, such as marketing, human resources, and management. How does finance...
-
4. What is the time complexity of the following procedure for in/2 to n do j 2 end for while (j
-
If the concentration of a constituent in the influent to the equalization basin is constant over the 24 h period, will the load of the constituent from the basin be constant? If the concentration of...
-
A three-phase transmission line of a 60 Hz circuit has a length of 370 km (230 miles). the conductors are of the 795,000cm (54/7) type with horizontal spacing of 25 feet between them. The load on the...
-
Simulate rolling a dice using Math.random() . Your roll function should allow the caller to specify any number of sides, but default to 6 if no side count is given: roll() assumes a 6 sided dice,...
-
Drama Read the excerpt from a play. Then, answer the question(s). (1) (2) Belle: Having trouble deciding what will make you look like both a power to be reckoned with and a fetching young lady while...
-
According to Fraser and Ormistan, in financial analysis, which question is management not trying to answer? How well have the financials performed? What are strengths and weaknesses of the financial...
-
What do you think?
-
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...
-
Is there an observation that may look as though it is an outlier? Explain. For Exercises 24 and 25, use the scatter plot in Figure 8.23 to answer the questions.
-
Will the value of s be closer to 10, 100, 1000, or 10,000? Why?
-
Will the p-value for the hypothesis test for the existence of a linear relationship between the variables be small or large? Explain.
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App