Ex 4) Trace the following flowchart for when input values are 12, -2, -3, 6, -11, 3, 1, -1 and complete the trace table. Also, write pre- post-conditions for this flowchart. start | cnt1–0 cnt2 +0 i +1 i+i+1 num is 4 num<0 T ent1 ( cnt1 + 1 i +1 i←i+1 num is 4 num>0 T cnt2 + cnt2 + 1 F cnt1=cnt2 "yes" (end) "no"

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 9SA
icon
Related questions
Question
Ex 4) Trace the following flowchart for when input values are 12, -2, -3, 6, -11, 3, 1, -1 and complete the trace
table. Also, write pre- post-conditions for this flowchart.
start
cnt1+0
cnt2 <0
i←1
i←i+1
num
is 4
num<0
T
cnt1 + cnt1 +1
T
F
F
i ←1
i←i+1
num
is 4
num>0
T
cnt2 cnt2 +1
F
F
cnt1=cnt2
T
"yes"
end
"no"
Transcribed Image Text:Ex 4) Trace the following flowchart for when input values are 12, -2, -3, 6, -11, 3, 1, -1 and complete the trace table. Also, write pre- post-conditions for this flowchart. start cnt1+0 cnt2 <0 i←1 i←i+1 num is 4 num<0 T cnt1 + cnt1 +1 T F F i ←1 i←i+1 num is 4 num>0 T cnt2 cnt2 +1 F F cnt1=cnt2 T "yes" end "no"
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Concept of Flowchart
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,