Question: Part 1. Loops, Counters, and Accumulators (4 points each) Answer the following questions based on the program segment below. Assume all variables are of type
Part 1. Loops, Counters, and Accumulators (4 points each) Answer the following questions based on the program segment below. Assume all variables are of type integer data 7; nli number-0 while (number 10) m- m 1 n data1; data data + number number number 10 1. Is the variable m an unconditional counter? Justify your answer 2. When the loop terminates, is the value of number equal to 50? Justify your answer. 3. What is the loop control variable? Justify your answer. 4. Is data an unconditional accumulator? Justify your answer. Is n a conditional counter? Justify your
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
