Trace the following flowchart for the input values 3, 12, -2, 5, 15, 1, 1, 1 and complete the trace table. Also, write pre-post-conditions for this flowchart. start sum1(0 sum2-0 i+1 i+i+1 num F i≤4 sum1 +sum1 + num i+1 F i≤4 i+i+1 sum1=sum2 num T "no" "yes" sum2sum2+ num end end 3) Trace the following flowchart for when input values are -10, -1, 3, 2, 11, 13, 1, 0 and complete the trace table. Note that the system may end before all of the inputs have been received; if this occurs you ignore the final inputs. Also, write pre-post-conditions for this flowchart. start p+0 n 0 num num>0 IT p<-p+1 T num 0 and p≤2*n F end num<0 T nn+1 output

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter5: Looping
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question

Please help me with these questions. It is urgently needed. Please construct a Javascript code based on the the following flowcharts below. Note: Please implement several functions that require multiple inputs (e.g. 12, 2, -3, 6,
-11, -3, 1, -1). In these cases, accept as input a comma delimited string (i.e. “12, 2, -3, 6, -11, -3, 1,
-1”). Then, break the comma delimited string into a series of integers for processing with your
algorithm. Just provide the JavaScript code for each flowchart. Nothing else

Trace the following flowchart for the input values 3, 12, -2, 5, 15, 1, 1, 1 and complete
the trace table. Also, write pre-post-conditions for this flowchart.
start
sum1(0
sum2-0
i+1
i+i+1
num
F
i≤4
sum1 +sum1 + num
i+1
F
i≤4
i+i+1
sum1=sum2
num
T
"no"
"yes"
sum2sum2+ num
end
Transcribed Image Text:Trace the following flowchart for the input values 3, 12, -2, 5, 15, 1, 1, 1 and complete the trace table. Also, write pre-post-conditions for this flowchart. start sum1(0 sum2-0 i+1 i+i+1 num F i≤4 sum1 +sum1 + num i+1 F i≤4 i+i+1 sum1=sum2 num T "no" "yes" sum2sum2+ num end
end
3) Trace the following flowchart for when input values are -10, -1, 3, 2, 11, 13, 1, 0 and
complete the trace table. Note that the system may end before all of the inputs have
been received; if this occurs you ignore the final inputs. Also, write pre-post-conditions
for this flowchart.
start
p+0
n 0
num
num>0
IT
p<-p+1
T
num 0 and
p≤2*n
F
end
num<0
T
nn+1
output
Transcribed Image Text:end 3) Trace the following flowchart for when input values are -10, -1, 3, 2, 11, 13, 1, 0 and complete the trace table. Note that the system may end before all of the inputs have been received; if this occurs you ignore the final inputs. Also, write pre-post-conditions for this flowchart. start p+0 n 0 num num>0 IT p<-p+1 T num 0 and p≤2*n F end num<0 T nn+1 output
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr