a) Below is the pseudo-code for a TEST program: 0 program TEST 1 varl, var2, var3:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
a) Below is the pseudo-code for a TEST program: 0 program TEST 1 varl, var2, var3: integer 2 easy: boolean 2 begin 3 4 5 6 7 8 9 10 11 12 13 14 ∞0 O read (var2) read (varl) read (easy) If (easy = true) then var3 = var2 + varl print (var3) if varl = 5 then print (var1) print (var1+1) else endif var2 = var2 + 1 else 15 16 17 18 endif 19 write (var2) 20 end program TEST. var2 = 0 write ("Wow that was tricky!") i. Draw the control flow graph for the above Pseudo-code. ii. Find the cyclomatic complexity. iii. How many independent paths are present in your control flow graph? a) Below is the pseudo-code for a TEST program: 0 program TEST 1 varl, var2, var3: integer 2 easy: boolean 2 begin 3 4 5 6 7 8 9 10 11 12 13 14 ∞0 O read (var2) read (varl) read (easy) If (easy = true) then var3 = var2 + varl print (var3) if varl = 5 then print (var1) print (var1+1) else endif var2 = var2 + 1 else 15 16 17 18 endif 19 write (var2) 20 end program TEST. var2 = 0 write ("Wow that was tricky!") i. Draw the control flow graph for the above Pseudo-code. ii. Find the cyclomatic complexity. iii. How many independent paths are present in your control flow graph?
Expert Answer:
Answer rating: 100% (QA)
From the provided pseudocode we can create a control flow graph which is a graphical representation showing the flow of control through the program Ea... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Speeding up and slowing down A 1400kg car, starting from rest, accelerates to a speed of 30mph in 10 seconds. a) What is the force on the car (assumed constant) over this period of time? b) Where...
-
If the focal length of a lens is 3 centimeters and the image distance is 5 centimeters from the lens, what is the distance from the object to the lens?
-
ABS plastic is a tough, hard plastic used in applications requiring shock resistance. The polymer consists of three monomer units: acrylonitrile (C3H3N), butadiene (C4H6, and styrene (C8H8). a. Draw...
-
Marianne Mooney, benefits manager and her sister, Laureen, a middle-school teacher from Pompano Beach, Florida, are interested in the numbers of real estate investments. They have reviewed the...
-
Solve the equation. x -2/3 + x -1/3 - 6 = 0
-
Generate the full set of clauses for the map-coloring graph in Figure 8.1. Resolve these clauses to prove that a three-coloring solution does exist for the graph. data from figure 8.1 A B C D
-
a. What is the maximum amount that Roy should advise his client to withdraw on her 60th birthday? If she lives until age 90, how much should the client expect to leave to her heirs? b. Roy is now...
-
How does the Internet facilitate piracy? How might we explain the high levels of involvement in such practices by young people? Whose interests does the criminalization of copying serve? Is there a...
-
State Banks balance sheet is listed below. Market yields and durations (in years) are in parenthesis, and amounts are in millions. a. What is State Banks duration gap? b. Use these duration values to...
-
For zero-coupon bond inputs P(0,1)=0.92, P(0,2)=0.86 and P(0,3)=0.82, and Ho-Lee parameters pi=0.6 and delta=0.98, Use the Ho-Lee model to calculate the value of the zero coupon bond at node (2,0)...
-
A system's I/O equation is provided as \[\frac{5}{6} y^{(4)}+\dddot{y}+\frac{1}{6} \ddot{y}+\frac{1}{2} y=\dddot{u}+\dot{u}+\frac{1}{3} u\] a. Find the state-space representation in controller...
-
Find the state-space form directly from the I/O equation. \(y^{(4)}+\ddot{y}+\frac{1}{4} \dot{y}+y=4 u\)
-
Find the state-space form directly from the I/O equation. \(2 y^{(4)}+\ddot{y}+2 \dot{y}+y=\dddot{u}+2 \ddot{u}+u\)
-
Find the state-space form directly from the I/O equation. \(\frac{2}{3} \ddot{y}+\dot{y}+\frac{3}{2} y=\frac{1}{3} \ddot{u}+\dot{u}+u\)
-
Find the state-space form directly from the I/O equation. \(\frac{1}{2} \ddot{y}+\dot{y}+y=\dot{u}\)
-
When making decisions, it is best to use which? Average costs Variable costs that would be incurred Relevant costs Unit costs, rather than total costs Fixed costs that would be incurred
-
Write a paper about the Working relationship in the organization- collaboration within and outside the organization
-
(a) use the zero or root feature of a graphing utility to approximate the zeros of the function accurate to three decimal places, (b) determine the exact value of one of the zeros, and (c) use...
-
Use Descartes's Rule of Signs to determine the possible numbers of positive and negative real zeros of the function. 1. g (x) = 5x3 + 3x2 6x + 9 2. h (x) = 2x5 + 4x3 2x+ + 5
-
Solve the equation. (Round your solution to three decimal places.) 1. 0.275x + 0.725(500 x) = 300 2. 2.763 4.5(2.1x 5.1432) = 6.32x + 5 3. 2 / 7.398 - 4.405 / x = 1 / x 4. 3 / 6.350 - 6 / x = 18
-
Find the natural frequencies of a fixed-fixed bar undergoing longitudinal vibration, using three mesh points in the range \(0
-
The ends of a beam are elastically restrained by linear and torsional springs, as shown in Fig. 11.11. Using the finite difference method, express the boundary conditions. k W(x) k 00000 Deflected...
-
Using the fourth-order Runge-Kutta method, solve Problem 11.20. Data From Problem 11.20:- The equations of motion of a two-degree-of-freedom system are given by \(2 \ddot{x}_{1}+6 x_{1}-2 x_{2}=5\)...
Study smarter with the SolutionInn App