1.1 In each of the following cases do the following: Write only the specified structures, do not write the whole algorithm. Make use of the pre-test loop (for-loop and do-while) in pseudocode using the variable names as provided. The number of times that the loop will execute, The value of the counter control variable after execution of the loop and e.g. Use a counter variable called count1 that has an initial value of 0 and a final value of 35
(1) a. for count1 = 0 to 5 b. 6 times c. 6 a. count1 = 0 while count1 <=5 b. 6 times c. 6
1.1.1 Use a counter variable called studentCount that has an initial value of 50, a final value of 0, and a decrement of 2.
1.1.2 Use a counter variable called countX that has an initial value of 31, a final value of 15, and an increment of -3.
(1)
or count1 = 0 to 35 step 7
display "count1 = ", count1
next count1
display "count1 = ", count
count1 = 0
while count1 <= 35
display "count1 = ", count1
count1 += 7
loop
display "count1 = ", count1
1.1.1
studentCount = 50
while studentCount >= 0
display "Student count = ", studentCount
studentCount = studentCount -2
loop
1.1.2
for countX = 31 to15 step -3
display "countX = ", countX
next countX
Comments
Leave a comment