Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ut the following lines into a glowscript script and run them: listofParticles = [] for i in range(0, 100): posx = 80*(random()-0.5) posy = 80*(random()-0.5)
ut the following lines into a glowscript script and run them: listofParticles = [] for i in range(0, 100): posx = 80*(random()-0.5) posy = 80*(random()-0.5) posz = 80*( random()-0.5) vx = 100*(random()-0.5) vy = 100*(random()-0.5) vz = 100*(random()-0.5) newparticle = sphere(pos=vector(posx, posy, posz), radius=1) newparticle.mass = 1 newparticle.velocity = vector(vx, vy, vz) listofParticles.append(newparticle) You may want to edit the program to answer the following questions. (a.) What does range(0,100) provide? A list of numbers from 0 to 99. You are correct. Your receipt no. is 153-5071 Previous Tries (b.) What is the minimum value of random()? You are correct. Previous Tries Your receipt no. is 153-7 (c.) What is the minimum y-component of the velocity a particle in listOfParticles may have? Submit Answer Incorrect. Tries 2/99 Previous Tries (d.) What is the piece of the code that adds a particle to the list? listOfParticles.append(newparticle) You are correct. Your receipt no. is 153-1573 Previous Tries (e.) After the program has gone through the code in the for loop 5 times, how many items (particles) are in listOfParticles? Submit Answer Tries 0/99
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started