Question: What is the value of k after the following algorithm has been executed? Justify your answer. What counting formula did you apply? k =
What is the value of k after the following algorithm has been executed? Justify your answer. What counting formula did you apply? k = 0; for it = 1 to 8 for i2 = 1 to 1 for i3 = 1 to 2 : for 10 =1 to ig k = k + 1; Q3. Which of the following statements are true? Justify your answers. Which counting principles did you apply? 1. A programmer wrote 690 lines of code in 14 days. There must have been at least 1 day when the programmer wrote 50 or more lines of code. 2. One must pick up at least 80 integers from 1 through 100 (both 1 and 100 are included) in order to be sure of getting one that is divisible by 5.
Step by Step Solution
There are 3 Steps involved in it
Answer k 0 for i1 1 to 8 for i2 1 to 1 for i3 1 to 2 for i10 1 to ig k k 1 The counting formula for ... View full answer
Get step-by-step solutions from verified subject matter experts
