Matlab codes quick questions

Read each question carefully. Questions 13 are 10 points each. Question 4 is 20 points. Total 50 points.
For Questions 12, submit your answers in a single MS Word or PDF file. For Question 34, submit the two written script files along with the MS Word or PDF file. Three files should be submitted.
Do NOT submit screenshots.

1. Draw the flow diagrams for for loop and while loop, separately. (10 points)

2. What does a jump statement do to an iteration statement? What is the difference between a break statement and a continue statement? (10 points)

3. The Taylor series for the exponential function ex is given below. Write a script file using the proper iteration statement to read in a number x and calculate its exponential using Taylor series for the first 10 terms. (10 points)

1 + (𝑥^𝑛
𝑛! )

𝑛=1

4. Write a script program using a proper loop statement to perform the following tasks: (20 points)
(1) Perdetermine a random integer (rand_int) between [09] by the program (hint: use randi() ).

(2) Let the user guess a number (number) entered from the keyboard to be compared with the random integer (rand_int).

(3) If the value of number matches the value of rand_int, the program should display a message Bingo! The guessing is stopped by the program. and terminate.

(4) If the two values of number and rand_int are not matched, the program should ask whether the user wants to keep guessing by displaying Wrong guessing… try again?.

(5) To continue guessing, a character ‘Y’ or ‘y’ should be entered from the keyboard; to stop guessing, a character ‘N’ or ‘n’ should be entered, and display The guessing is stopped by the user..

(Carefully examine through our inclass examples and exercises. Understand which loop should be used, which condition should be used for logical evaluation, and what the order of different commands should be within the loop. When you see specific keywords, e.g. keep, stop, terminate, continue, etc., know what iteration statement with jump statements should be used. Try making modifications to inclass demos to construct the program.)