Question: how to write these two in js Ex 5) This exercise uses sub-algorithms. Trace it for when input value is 6 and complete the trace


how to write these two in js
Ex 5) This exercise uses sub-algorithms. Trace it for when input value is 6 and complete the trace tables. Also note that there are two variables name num, one in the main algorithm and another in the sub-algorithm. Write pre- post-conditions for each of these algorithms (the main one and the sub-algorithm). start prime(num) rende num start i2 flag - true de 2 isnum iri+1 T flag and dsnum/2 prime(1) nm mod d = 0 T flag-false de d+1 end ret flag Ex6) Devise an algorithm to receive Ex 4) Trace the following flowchart for when input values are 12,3,-3,6,11, 3,-1,-1 and complete the trace table. Also, write pre- post-conditions for this flowchart. start cnt10 cnt20 F 54 1 T num F 12+1 F macam T ent1=cnt2 num "no" cnica "yes" F num0 I end cnt2 ant2 + 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
