Exam 10: Astronomy: Creating Classes, Writing Constructors, Accessors, Mutators and Special Methods
Exam 1: Introduction to Python: Introduction to Numeric Types, Turtle Graphics, Simple for Loops and Functions34 Questions
Exam 2: Pthon: Estimating PI: Math and Random Methods, Selection and Boolean Expressions, the Print Function33 Questions
Exam 3: Codes and Other Secrets: String Operators and Methods, the Len Built-In Function, Keyword Parameters, User Input33 Questions
Exam 4: Introducing the Python Collections: Lists, Dictionaries, Tuples, and Statistics33 Questions
Exam 5: Bigger Data: File Io: the While Loop, String Formatting, Reading Online Data in CSV and Json Formats33 Questions
Exam 6: Image Processing: Nested for Loops, Functions As Parameters, Namespaces, Lists of Lists33 Questions
Exam 7: Data Mining: Cluster Analysis: More on the While Loop; Parrallel Lists31 Questions
Exam 8: Cryptanalysis: Advanced Dictionaries and Lists, Regular Expressions32 Questions
Exam 9: Fractals: the Geometry of Nature: Recursion, Grammars and Production Rules33 Questions
Exam 10: Astronomy: Creating Classes, Writing Constructors, Accessors, Mutators and Special Methods33 Questions
Exam 11: Simulation:computer Simulation Using Objects34 Questions
Exam 12: Father Was a Rectangle: Inheritance and Object-Oriented Design32 Questions
Exam 13: Video Games: Multithreading, Event Handlers, Static Variables33 Questions
Select questions type
Match each definition with its term.
-Refers to the values of all instance variables for an object.
(Multiple Choice)
4.7/5
(34)
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?
(Multiple Choice)
4.9/5
(27)
Match each definition with its term.
-Describes a procedure that changes an object in some way.
(Multiple Choice)
4.8/5
(40)
Algorithms describe the solution to a problem in terms of the data needed to represent the problem instance and a set of steps necessary to produce the intended result.
(True/False)
4.8/5
(43)
Each object from a particular class has the same instance variables, but the values of those variables are different, therefore allowing the object to "behave" differently when asked to perform methods.
(True/False)
4.9/5
(34)
Preceding an instance variable name by two underscores____ the instance variable.
(Multiple Choice)
4.9/5
(37)
Which of the following is one of Python's collection classes?
(Multiple Choice)
4.8/5
(37)
The turtle module only allows one turtle to exist simultaneously in the same window.
(True/False)
4.8/5
(49)
The __class__ method is used to provide each object with a reference to the class definition object to which it belongs.
(True/False)
4.9/5
(41)
____ objects store method names that refer to method definitions that are implemented by the class.
(Multiple Choice)
4.9/5
(38)
Showing 21 - 33 of 33
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)