Question
Verify for at least two examples of N 4 that the factorial function does calculate N! by hand. 2. Give two reasons why using a
Verify for at least two examples of N 4 that the factorial function does calculate N! by hand.
2. Give two reasons why using a function (or subroutine) makes code easier to test. 3. Write flowchart for Task C.
4. Write flowchart for Task D.
Task C: Fibbonacci Sequence, Part Two Write a program that fulfills the following criteria. When the r key is pressed, Scratch asks for F1 and F2, the first two terms in a Fibbonacci sequence. Then, Scratch asks for an integer M. Scratch then calculates FN using a function f ib calc2. Note that this function will require a repeat until-type loop. After Scratch calculates FM, she tells the user what the result is.
Task D: Square-Root Approximation Write a program that that fulfills the following criteria. When the r key is pressed, Scratch asks for A, the number whose square root the user would like to know. Then Scratch asks for an initial guess current guess. However, Scratch will accept neither negative numbers nor zero as an initial guess. Then when the c key is pressed, using a function sqrt calc, Scratch will find the next guess next guess. Scratch then displays the next guess. The sqrt calc function sets current guess to next guess and then calculates next guess using the assignment next guess = 1/ 2 ( current guess + A/current guess) .
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started