1.1 A loop must be terminated when the total value of less than a 0 (Zero) is entered.
a. do while total > 0
b. do while total = 0
c. do while total < 0
d. do while total >= 0
1.2 Study the following series: 3; 6; 10; 15; 21; . . .
The next element in the series is
a. 26
b. 28
c. 30
d. 32
1.3 In order for students to qualify for the next module they need to pass one of the two assessments. Which operator will be correct to test these conditions in a do while loop.
a. AND
b. OR
c. NOT
d. Any logical operators as they have the same order of precedence
1.1 : d) do while total>=0
because value total<0 is stop sign;
1.2 :b) 28 because
6=3+3;10=6+3+1;15=10+4+1;21=15+5+1;28=21+6+1.
1.3 b) OR
because (As1)OR(As2)=true=> {qualification;end}
Comments
Leave a comment