Week 7 Flashcards

1
Q

is a way of writing code where we group related data and actions together into objects.

A

OOP (Object-Oriented Programming)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

are the things you think about first in designing a program and they are also the units of code that are eventually derived from the process.

A

Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

is an instance of a class. It represents a real-world entity with attributes (data members) and behaviors (member functions).

A

Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

It is created from a class.

A

Objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

is an object-oriented programming language.

A

C++

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

are basically variables and functions that belongs to the class.

A

Attributes and Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

These are often referred to as “class members”.

A

Attributes and Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Only the specification for the object is defined; no memory or storage is allocated. To use the data and access functions defined in the class, you need to create objects.

A

Attributes and Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

is a user-defined data type that we can use in our program, and it works as an object constructor, or a “blueprint” for creating objects.

A

class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

is a user-defined data type, which holds its own data members and member functions, which can be accessed and used by creating an instance of that class. A C++ class is like a blueprint for an object.

A

Class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

When it is defined, only the specification for the object is defined; no memory or storage is allocated. To use the data and access functions defined in the class, you need to create objects.

A

Class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Information an object has (e.g., a car’s color or speed).

A

Data (Attributes)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Actions an object can do (e.g., a car can start or stop). This makes programs organized, reusable, and easier to manage because everything related is kept together.

A

Behavior (Methods)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

are the data variables and member functions are the functions used to manipulate these variables together, these data members and member functions define the properties and behaviour of the objects in a Class.

A

Data Members

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

is a special method that is automatically called when an object of a class is created.

A

Constructor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

is also a special member function like a constructor. -_________ destroys the class object created by constructors.

A

Destructor

17
Q

is the last function that is going to be called before an object is destroyed. It is used to free resources like memory, close files, or clean up when an object is no longer needed.

A

Destructor

18
Q

Functions are defined directly inside the class.

A

Inside Class

19
Q

Treated as inline by default, improving performance for small functions.

A

Inside Class

20
Q

Good for small, simple functions.

A

Inside Class

21
Q

Functions are declared inside the class but defined outside** using ::.

A

Outside Class

22
Q

Keeps the class clean and organized, especially for large functions.

A

Outside Class

23
Q

Preferred for complex or long functions.

A

Outside Class

24
Q

The public keyword is an ________

A

Access Specifiers

25
Define how the members (attributes and methods) of a class can be accessed. In the example above, the members are public - which means that they can be accessed and modified from outside the code.
Access Specifiers
26
members are accessible from outside the class
public
27
members cannot be accessed (or viewed) from outside the class
private
28
members cannot be accessed from outside the class, however, they can be accessed in inherited classes
protected
29
are declared inside a class and are used to store values in an object. Each object has its own copy of instance variables that are not shared between other objects.
Instance Variable
30
It can be declared in a class or a function. When declared in class, it is shared between all the objects of that class.
Static Variable
31
We can access a ________ by class name using the scope resolution operator or by the object of the class using a dot (.) operator.
Static Variable
32
Each object does not have a separate copy of ________ so it can't be initialized using a constructor. They are initialized outside the class using the class name and scope resolution operator.
Static Variable
33
are used to store or process data stored in instance variables and are used only by the object of the class
Instance Methods
34
When a function is declared in a class, it is called ______
Method
35
Are defined inside a class using the keyword static.
Static Methods
36
These methods are bound to the class and not to the object, which means that these methods can be called using the class name, and calling the methods using the object name is not necessary. However, the object of the class can also access the static methods using the object name.
Static Methods