Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What are data members in a class?
Think about attributes or characteristics of an object.
Can a class have multiple member functions?
Consider how a car can accelerate and brake.
What are data members in a class?
Think of them as properties of an object.
True or False: A class can have multiple methods that act on its data members.
Consider how many different actions an object can perform.
Create a class called 'Smartphone' that has data members for 'brand', 'model', and methods for 'call' and 'text'. Write the code.
Focus on how you can represent common smartphone attributes and actions.
Explain the relationship between data members and member functions by illustrating how a class named 'BankAccount' can be structured to manage a balance and transactions.
Think about how you would want to track and change the balance.
5 more questions in this section. Enroll free to practise them all.
Enroll free