Part 2: Edit copy lab06.html, lab06.js and lab06.css to lab06.html, lab06.css, and lab06.js. In your html file, create 6 buttons with the names Problem 1, Problem 2, ..., Problem 6. Then, implement all 6 flowcharts in your lab06.js. When each button is clicked, the event handler should execute the corresponding algorithm in your js file. Note that you will have to 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. You may want to research the 'split' method for strings in Javascript to learn how to break a string apart into many pieces. Ex 5) This exercise uses sub-algorithms. Trace the algorithm when input value is 4 and complete the trace tables. Also note that there are two variables named num. One is in the main algorithm and another is the sub-algorithm. Write pre- post-conditions for each of these algorithms (the main one and the sub-algorithm). num output start num prime(num) start num flag d returned value 14-2 is num i+i+1 T prime()=true flag-true d2 flag=true and dsnum/2 num mod d = 0 flag false dd+1 end ret flag

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 18PE
icon
Related questions
Question

Please help me with this question. I am not understanding what to do. Please complete part 2 for the question. I am extremely confused

(You do not need to do the contents of ex 5 Just need the part 2 for the question)

Part 2: Edit copy lab06.html, lab06.js and lab06.css to lab06<yourname>.html,
lab06<yourname>.css, and lab06<yourname>.js. In your html file, create 6 buttons with the names
Problem 1, Problem 2, ..., Problem 6. Then, implement all 6 flowcharts in your lab06<yourname>.js.
When each button is clicked, the event handler should execute the corresponding algorithm in your
js file.
Note that you will have to 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. You may want to research the 'split' method for strings in Javascript to learn how to break
a string apart into many pieces.
Transcribed Image Text:Part 2: Edit copy lab06.html, lab06.js and lab06.css to lab06<yourname>.html, lab06<yourname>.css, and lab06<yourname>.js. In your html file, create 6 buttons with the names Problem 1, Problem 2, ..., Problem 6. Then, implement all 6 flowcharts in your lab06<yourname>.js. When each button is clicked, the event handler should execute the corresponding algorithm in your js file. Note that you will have to 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. You may want to research the 'split' method for strings in Javascript to learn how to break a string apart into many pieces.
Ex 5) This exercise uses sub-algorithms. Trace the algorithm when input value is 4 and
complete the trace tables. Also note that there are two variables named num. One is in the
main algorithm and another is the sub-algorithm. Write pre- post-conditions for each of
these algorithms (the main one and the sub-algorithm).
num
output
start
num
prime(num)
start
num
flag d
returned value
14-2
is num
i+i+1
T
prime()=true
flag-true
d2
flag=true and
dsnum/2
num mod d = 0
flag false
dd+1
end
ret flag
Transcribed Image Text:Ex 5) This exercise uses sub-algorithms. Trace the algorithm when input value is 4 and complete the trace tables. Also note that there are two variables named num. One is in the main algorithm and another is the sub-algorithm. Write pre- post-conditions for each of these algorithms (the main one and the sub-algorithm). num output start num prime(num) start num flag d returned value 14-2 is num i+i+1 T prime()=true flag-true d2 flag=true and dsnum/2 num mod d = 0 flag false dd+1 end ret flag
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
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