Assessment 3: lessons 11 - 14

Use this space for any questions related to the third fixed-response assessment.

Hi, Brook
Unit 5 Assessment 3, Q10: The studio is telling us that â€śBâ€ť is the answer, however, I believe it should be â€śCâ€ť as the question states â€śA statistician would like to simulate rolling a single die until she has rolled the die a total of 100 times, or she rolls a six a total of 25 times, whichever comes first. Which boolean expression should she use for the to accomplish this?â€ť
Answer B is: rolls < 100 && sixes < 25
Answer C is: rolls < 100 || sixes < 25
Thanks for clarifying!

hi, @cconnor!

this is a tricky question, in part because the prompt is making you think about the conditions needed to stop rolling the die, but the program code youâ€™re filling in defines the conditions needed in order to roll the die.

this is because weâ€™re filling in the missing code on the while loop that is simulating the rolling of the die. we have to ask: `what are the conditions needed in order to keep rolling the die?` based on the prompt, we want to keep rolling the die as long as the number of rolls is under 100 and the number of 6â€™s is under 25. if either of those conditions isnâ€™t true, we will exit the loop. for example, if we imagine that weâ€™re on our 100th roll and our 20th time rolling a 6, the conditions in the while loop would be: `100 < 100 && 20 < 25` and this would evaluate to false, because 100 is not less than 100. since this evaluates to false, weâ€™ll exit the loop and in the simulation we will stop rolling the die.

hope this helps!

-brook

1 Like

Test 4 Question 1 - How is not 4? Student tried in code studio and got this for the answer? @brook

hi, @carmichaelc!

in this question, i starts at 1 and increments by one each time the loop executes, and the loop executes until i=5. this means that the code inside the loop only executes 4 times (when i = 1, 2, 3, and 4) and each of those times through the loop correspond to updating the value of indexes 1- 4 in the array. BUT, because the loop runs until i=5, we donâ€™t actually do anything to value in index 5, as the loop doesnâ€™t execute (and the last value isnâ€™t replaced).

hope this helps!

On questions 11-18 you have students using Arrays that begin with an index of 1. Why would you change that all of a sudden, when the entire lesson we have taught them to use index 0 in java script?

1 Like

@charles.sanford

Although Javascript indexes arrays starting at 0, the CBâ€™s pseudo-code indexes arrays starting at 1. In order to prepare for the paper/pencil exam, students will need to practice answering questions based on the pseudo-codeâ€™s way of indexing.

Happy computing,
Andrea