Which of the following correctly displays the total all of the values stored in
ID: 3761638 • Letter: W
Question
Which of the following correctly displays the total all of the values stored in myArray?
Constant Integer SIZE = 80
Declare Integer index = 0
Declare Real arrayTotal = 0
Declare Real myArray[SIZE]
For index = 1 to SIZE
Set arrayTotal = arrayTotal + myArray[index]
End For
Display arrayTotal
For index = 0 to SIZE -1
Set arrayTotal = myArray[index]
End For
Display arrayTotal
For index = 0 to SIZE -1
Set arrayTotal = arrayTotal + myArray[index]
End For
Display arrayTotal
For index = 1 to SIZE
Set arrayTotal = myArray[index]
End For
Display arrayTotal
a.For index = 1 to SIZE
Set arrayTotal = arrayTotal + myArray[index]
End For
Display arrayTotal
b.For index = 0 to SIZE -1
Set arrayTotal = myArray[index]
End For
Display arrayTotal
c.For index = 0 to SIZE -1
Set arrayTotal = arrayTotal + myArray[index]
End For
Display arrayTotal
d.For index = 1 to SIZE
Set arrayTotal = myArray[index]
End For
Display arrayTotal
Explanation / Answer
For index = 1 to SIZE
Set arrayTotal = arrayTotal + myArray[index]
End For
Display arrayTotal
Example ::
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.