4. Draw a control flow graph (CFG) for the program specified using pseudocode in Figure 1...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
4. Draw a control flow graph (CFG) for the program specified using pseudocode in Figure 1 and calculate the total number of paths in the CFG. begin end read(i); j = 0; if (i > 500) j = 400; endif; if (i + j < 900) print("error"); else k := 2*i + 5*j; print(k); endif; Figure 1. The pseudocode of a program 1 Based on the CFG, design a test suite to achieve 100% statement and branch coverage for the program specified in Figure 1. (20 marks) 4. Draw a control flow graph (CFG) for the program specified using pseudocode in Figure 1 and calculate the total number of paths in the CFG. begin end read(i); j = 0; if (i > 500) j = 400; endif; if (i + j < 900) print("error"); else k := 2*i + 5*j; print(k); endif; Figure 1. The pseudocode of a program 1 Based on the CFG, design a test suite to achieve 100% statement and branch coverage for the program specified in Figure 1. (20 marks)
Expert Answer:
Answer rating: 100% (QA)
The given pseudocode specifies a simple program with conditional logic To draw a Control Flow Graph CFG for this program we must represent the logical ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Examine your discriminative listening skills according to each of the five skills. Please give examples and note your strengths and weaknesses. Clearly identify each skill and number your responses...
-
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...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
How are financial statements adjusted for exchange rates?
-
Briefly explain the accounting treatment for sales returns and allowances. Where are these accounts reported in the income statement?
-
What are the factors the auditor should consider in determining the sample size for tests of controls as part of the auditor's attestation to management's assertion on the effectiveness of internal...
-
6. YOU BE THE JUDGE WRITING PROBLEM World-Wide Coin Investments Ltd. sold rare coins, precious metals, camera equipment, and Coca-Cola collector items. Its stock was registered with the SEC under the...
-
Flow in a slit with uniform cross flow (Fig. 3B.16). A fluid flows in the positive x-direction through a long flat duct of length L, width W, and thickness B, where L > > W >> B. The duct has porous...
-
discuss which method of inventory accounting is used or should be used in Macy's? Should a different method be utilized by the company? Provide a detailed analysis verifying your response.
-
Beverly and Ken Hair have been married for 3 years. Beverly works as an accountant at Cypress Corporation. Ken is a full-time student at Southwest Missouri State University (SMSU) and also works...
-
1. The aluminum W310x202 (wide flange) column is subjected to an eccentric axial load P as shown. The maximum compressive stress in the column is given by the so-called secant formula: Omax = [1 +...
-
Bob's Auto manufactures cars and currently uses only 50% of its manufacturing facility to make 30,000 cars per year. Bob could rent the unused portion of its plant and receive $3,000 a month....
-
In preparation for developing its statement of cash flows for the year just ended, D-Rose Distributors collected the following information: ($ in millions) Purchase of treasury bills (considered a...
-
Wildcat Company uses a job costing system that applies factory overhead based on direct labor. No job was in process on February 1.During February, the company worked on these three jobs. During the...
-
Consider the function f ( x ) = 2 x ^ 2 - 8 x ^ 4 . a ) Find all the critical numbers c of f . b ) Find where f is concave up and down . c ) Using the 2 nd derivative test, the local maxima and...
-
A particle with angle q = wt and [r] = ro e^ (b t) where w, ro and b are positive constants. Solve for the value of b such that r - component of the acceleration in polar coordinates is zero, i.e. ar...
-
10. Find E(Y) for the joint pdf given by f(x,y) = X , 0 < y < x < 1 0, elsewhere Hint: Use a double integral with order of integration dydx.
-
For the following arrangements, discuss whether they are 'in substance' lease transactions, and thus fall under the ambit of IAS 17.
-
Consider the following attribute grammar for variable declarations, based on the CFG: Show a parse tree for the string A, B : C;. Then, using arrows and textual description, specify the attribute...
-
Consider a language implementation in which we wish to catch every use of an uninitialized variable. In Section 6.1.3 we noted that for types in which every possible bit pattern represents a valid...
-
Write a C++ preorder iterator to supply tree nodes to the loop in Example 6.69. You will need to know (or learn) how to use pointers, references, inner classes, and operator overloading in C++. For...
-
A Mrs T Hulley is paid monthly. For part of April 19X6 she earns 860 and then goes on maternity leave, her maternity pay for April being 90. She has pay free of tax 320, whilst on the next 250 she...
-
A P Urmston is paid monthly. For June 19X6 he earns 1,500 and also receives statutory sick pay of 150. He pays 90 superannuation which is allowed as a relief against income tax and he has further...
-
The data which follows was extracted from the books of account of H Kirk, an engineer, on 31 March 19X6, his financial year end. You are required to allocate each or part of the items above to either...
Study smarter with the SolutionInn App