Exam 10: Object-Oriented Programming
Exam 1: Introduction102 Questions
Exam 2: Data and Expressions71 Questions
Exam 3: Control Structures129 Questions
Exam 4: Lists85 Questions
Exam 5: Functions83 Questions
Exam 6: Objects and Their Use54 Questions
Exam 7: Modular Design62 Questions
Exam 8: Text Files58 Questions
Exam 9: Dictionaries and Sets33 Questions
Exam 10: Object-Oriented Programming81 Questions
Exam 11: Recursion27 Questions
Select questions type
Special methods are methods that are automatically called in Python.
(True/False)
4.8/5
(32)
_______________ is a fundamental feature of object-oriented programming languages that allows for information hiding.
(Short Answer)
4.9/5
(30)
There is no means in Python for accessing the private members of a class.
(True/False)
4.9/5
(32)
Name mangling occurs when the identifiers within a class are not sufficiently distinct.
(True/False)
4.8/5
(42)
Match the descriptions with their terms:
-indicates the number of objects that may be associated
(Multiple Choice)
4.8/5
(35)
________ and _________ are methods providing controlled access to private instance variables.
(Short Answer)
4.8/5
(39)
Which of the following is the correct way to access private instance variable x in object a of type ClassA?
(Multiple Choice)
4.8/5
(31)
______________________ is used in Python to indicate that particular members of a class are to be considered private.
(Short Answer)
4.9/5
(48)
For a class named FullName that contains an __init__ method that is passed a first and last name to construct a new object with, give an instruction that creates a new object of type FullName containing the name "Yu Huang."
(Essay)
4.7/5
(45)
Interaction diagrams in UML are used to represent the interactions of the user of a given program.
(True/False)
4.9/5
(52)
Getters and setters are methods providing controlled access to private instance variables.
(True/False)
4.8/5
(36)
There are special methods in Python corresponding to both arithmetic and relational operators.
(True/False)
4.7/5
(43)
For a class named Money that stores a dollar and cent amount, give an appropriate __eq__ method that determines if two Money values are equal. (Note: the cent amount stored in Money objects is in the range 0 to 99.)
(Essay)
4.8/5
(36)
Special methods are predefined methods in Python that are automatically called, with names that begin and end with two ___________________ characters.
(Short Answer)
4.8/5
(35)
Give an appropriate __init__ method for a class named FullName that stores the first and last name of a given individual. Assume that the class contains (private) instance variables first_name and last_name.
(Essay)
4.9/5
(37)
The two methods that are implemented to display the value of a given object are named__________ and ___________.
(Short Answer)
4.8/5
(31)
Role names are used to describe an association between two classes.
(True/False)
4.9/5
(40)
For class FullName that contains an __init__ method that is passed a first and last name to construct a new object with, define a subclass of the FullName class named FullNamePlus that also stores a person's middle name. The subclass should include an __init__ method, getter/setter methods, and a __str__ methods that displays a name in the form lastname, firstname middlename. (Assume that class FullName contains getter methods accessing the first and last names.)
(Short Answer)
4.7/5
(41)
Showing 61 - 80 of 81
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)