logo CodeStepByStep logo

class_concepts

Language/Type: Python recursion

Answer the following questions about classes and objects:

What is an object?
(order shuffled)
How is an object different from a class?
(order shuffled)
What is the difference between object-oriented programming and procedural programming?
(order shuffled)
What is the difference between a parameter and a data attribute?
(order shuffled)
What is the difference between an accessor and mutator method?
(order shuffled)
Suppose we have a class BankAccount with a method compute_interest(self, rate). What is the correct syntax to call this method on a variable named acct?
How do you write a class whose objects can easily be printed on the console?
The following print statement is equivalent to which of the following? d1 = Date() ... print(d1)
What is abstraction?
(order shuffled)
How do objects provide abstraction?
(order shuffled)
When attributes are made private, client programs are not supposed to access them directly. How do you allow classes access to read these attributes' values, without letting the client break the object's encapsulation?
(order shuffled)
How does encapsulation make it easier to change the internal implementation of a class?
(order shuffled)
How can you tell whether a class is cohesive?
(order shuffled)
Why is it often considered poor style to put console I/O code into a class?
(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.