For Ex 4) Just include the post and precondition and for Ex 6) make the algorithm into HTML, CSS, and JavaScript. Please complete both question please. Just do those two things. There other instructions included in the question has already been completed. Thank you

CMPTR
3rd Edition
ISBN:9781337681872
Author:PINARD
Publisher:PINARD
Chapter14: Working With Formulas And Functions
Section: Chapter Questions
Problem 15QY
icon
Related questions
Question

Please help me with the questions. Below I am having trouble understanding what to do. For Ex 4) Just include the post and precondition and for Ex 6) make the algorithm into HTML, CSS, and JavaScript. Please complete both question please. Just do those two things. There other instructions included in the question has already been completed. Thank you

Ex 6) Devise an algorithm to receive a positive number, n, and output all prime numbers that are
smaller than n and have a digit 5. For example, if nis 100, the program should output 5,53 and 59.
Your solution should have a main algorithm and two sub-algorithms, let's call them
prime(num)and has5(num). Trace your algorithm and sub-sub-algorithm for the input 15.
You should provide pre- and post-conditions for all your 3 (sub)algorithms.
Transcribed Image Text:Ex 6) Devise an algorithm to receive a positive number, n, and output all prime numbers that are smaller than n and have a digit 5. For example, if nis 100, the program should output 5,53 and 59. Your solution should have a main algorithm and two sub-algorithms, let's call them prime(num)and has5(num). Trace your algorithm and sub-sub-algorithm for the input 15. You should provide pre- and post-conditions for all your 3 (sub)algorithms.
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
ent1 ( 0
cnt2+0
i-1
i-i+1
num
i≤4
num<0
T
cnt1 a cnt1 + 1
T
i 1
F
i≤4
i+i+1
F
T
cnt1=cnt2
num
T
"no"
"yes"
num>0
T
cnt2 cnt2+1
end
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 ent1 ( 0 cnt2+0 i-1 i-i+1 num i≤4 num<0 T cnt1 a cnt1 + 1 T i 1 F i≤4 i+i+1 F T cnt1=cnt2 num T "no" "yes" num>0 T cnt2 cnt2+1 end
Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Features of HTML
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.
Recommended textbooks for you
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage