8. Assume N 1, what is the value of people perDaytN1 at the end of this code? pe
ID: 3574359 • Letter: 8
Question
8. Assume N 1, what is the value of people perDaytN1 at the end of this code? people PerDay [N] 15 N N 1; peoplePer Day [N1 people per Day [N 11 31 9. Array scoresList has 10 elements with indices o to 9, accessed as scoresList tol to scoresList [9]. Write a statement that assigns the first element in scoresList with 77. scoresList has 10 elements with indices 0 to 9. Assign the last element with 84. 10. Array 11. If that array instead has 100 elements, what is the last elements index? innra 12 is at memory addrExplanation / Answer
8.
peoplePerDay[1] = 15;
N = 2;
peoplePerDay[2] = peoplePerDay[1] * 3; //Which means peoplePerDay[2] = 15 * 3 = 45.
So, by the end of the code, peoplePerDay[N] is, peoplePerDay[2] = 45.
9.
To assign the first element in scoreList with 77, the step is:
scoreList[0] = 77;
10.
To assign the last element in scoreList with 84, the step is:
scoreList[9] = 84;
11.
If the array has 100 elements, what is the last elements index.
scoreList[99] will be last element index.
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.