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
-
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?
-
Using the following data from the comparative statements of financial position of Dotte NV, illustrate horizontal analysis. ____________________ December 31, 2017 _______ December 31, 2016 Inventory...
-
An editorial in the Wall Street Journal in 2017 made the following observation: When the U.S. has a current-account deficit it has to have a capital-account surplus of the same amount. Briefly...
-
What is the difference between Mission System versus Enabling System CIs? What are their relationships. Using an office building, automobile, and an aircraft, illustrate the relationships.
-
The division managers of Chester Construction Corporation submit capital investment proposals each year for evaluation at the corporate level. Typically, the total dollar amount requested by the...
-
Identify the best definition for network event log analysis The process of properly gathering, safeguarding, and synthesizing network event logs to identify root cause of a system problem The process...
-
XYZ is a calendar-year corporation that began business on January 1, 2017. For 2017, it reported the following information in its current year audited income statement. Notes with important tax...
-
What should a personal mission statement focus on? A person's momentary goals based on recent interests and inquiries. The needs of the many, reflected in the goals of the few. Bringing harmony to...
-
i. Present the truth table and logic diagram for a half adder. ii. Implement the function F= A'B + AB' + AC' + A'C using a multiplexer. What is the size of the smallest multiplexer needed, assuming...
-
Nguni Limited is a medium-sized manufacturing company based in the East Rand, Johannesburg where it produces two main products, the Gunis and Unis respectively for local sales. Nguni Ltd successfully...
-
For the circuit below, if R, consumes full load current at zener voltage V and given that the load regulation is VR if Izk, Vzk and Pz. are given below. Determine the range of V, that will maintain...
-
(c) How do you classify an image form their histogram whether it is dark, bright, low contrast and high contrast? Draw the histogram for each class. The histogram of an image of size 64*64 with gray...
-
Consider the following C function that accepts two arguments, higher and lower, calculates the sum of all values stored between the higher and lower indexes of the array arr; and returns the result....
-
You are going to make the following contributions into a savings account: Year 1: $0 (1 year from today) Year 2: $1000 Year 3: $1000 Year 4: $2000 Year 5: $0 Year 6: $0 The account will earn 4.34% in...
-
Chloroplasts are illuminated until the levels of the Calvin cycle intermediates reach a steady state. The light is then turned off. How does the level of RuBP vary after this point?
-
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...
-
Derive the stiffness matrix of the system shown in Fig. 5.42. 00000 2m 8(t) * 2m ellee x(t) m 00000 FIGURE 5.42 Rigid bar connected to masses and springs.
-
An airplane wing, Fig. 6.30(a), is modeled as a three-degree-of-freedom lumped-mass system, as shown in Fig. 6.30(b). Derive the flexibility matrix and the equations of motion of the wing by assuming...
-
Find the flexibility and stiffness influence coefficients of the system shown in Fig. 6.29. Also, derive the equations of motion of the system. k1 k3 k4 000 /711 000 m2 000 my 000 FIGURE 6.29...
Study smarter with the SolutionInn App