Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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 ::

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote