Case Study 2:
1. def createSSandAnimate() :
2. ss = SolarSystem(2, 2)
3.
4. sun = Sun("SUN", 5000, 1000, 5800)
5. ss.addSun(sun)
6.
7. m = Planet("MERCURY", 19.5, 1000, .25, 0, 2, "blue")
8. ss.addPlanet(m)
9.
10. m = Planet("EARTH", 47.5, 5000, 0.3, 0, 2.0, "green")
11. ss.addPlanet(m)
12.
13. m = Planet("MARS", 50, 9000, 0.5, 0, 1.63, "red")
14. ss.addPlanet(m)
15.
16. m = Planet("JUPITER", 100, 49000, 0.7, 0, 1, "black")
17. ss.addPlanet(m)
18.
19. numTimePeriods = 2000
20. for aMove in range(numTimePeriods) :
21. ss.movePlanets()
22.
23. ss.freeze()
24.
-Refer to the session in the accompanying Case Study 2. Which line(s) perform the actual work of the animation?
A) 4-5
B) 10-11
C) 16-17
D) 19-21
Correct Answer:
Verified
Q10: An accessor method is most likely to
Q11: The print method invokes the _ method
Q12: _ objects store method names that refer
Q13: _ methods change an object in some
Q14: Preceding an instance variable name by two
Q16: Algorithms describe the solution to a problem
Q17: To create an instance of a class,
Q18: Each object from a particular class has
Q19: The _class_ method is used to provide
Q20: The turtle module only allows one turtle
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents