I am embarrassed to ask more questions to gain clarity about instructions in Unit 1’s materials. I have completed the studio, but I am unsure I formatted my
selectRandomEntry function properly. Also, I am not sure the result of my oxygenExpended is correct.
Here’s my approach to the
- Create a function that selects only one random entry from the
- Outside the function, I initialized an empty array to hold the results of a loop that’s grabbing the
astronautIdof the selected candidates. I kept this outside the function in attempts to have the function do one thing, but I’m worried I’m wrong about my approach.
My buildCrewArray function finds the animal objects using the array of IDs. ObjectsStudio01 works as it should, but I just wanted to check if my approach to the
selectRandomEntry is inefficient.
oxygenExpended function seems to calculate everything correctly except for the oxygen used. Each candidate seems to consume 0 kg of oxygen. I rounded the calculation of the
o2Used method to the three decimal places. I tested it with
candidateA, a radius of 2000, an orbital speed of 28000, and 3 orbits completed. Maybe, I’m calculating time wrong? I calculated how much time it would take for one orbit. Then, I multiplied it by the number of orbits completed.