Don L. answered 11/10/15
Tutor
5
(18)
Fifteen years teaching and tutoring basic math skills and algebra
Hi Brooke,
Part A is a loop looking for numbers divisible by seven. If the number is divisible by 7 it is printed. Result: 7, 14, 21, 28.
Part B uses the values associated with the positions of the days of the week. SUN = 0, ..., SAT = 6. Research = value of FRI, which is 5. Busiest = value of THU, which is 4, and football = MON, which is 1.
Then 5 - 1 + 4 = 8
Part C is a double "for" loop with the outer loop varying "i" and the inner loop varying "j". The result of the run is:
X
XX
XXX
XXXX
XXXXX
Part D uses a temporary variable to hold a value while another variable is set.
Line one, temp = a = 0, a = b = 1, b = temp = 0
Line two, temp = a = 1, a = c = 2, c = temp = 1
Result: a = 2, b = 0, c = 1, output 2 0 1
Questions?