Week 9 Flashcards

1
Q

Naming a file or a variable is the first and the very basic step that a programmer takes to write clean codes, where naming has to be appropriate so that for any other programmer it acts as an easy way to read the code. In C++, naming conventions are the set of rules for choosing the valid name for a variable and function in a C++ program.

A

Naming Convention

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

Advantages of naming Conventions

A

*Avoids naming conflicts.
*Improves clarity of the code in case of ambiguity.
*Helps to formalize and promote consistency within a team.
*Improves understanding and readability of the code.

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

This is a style where words within a name are capitalized, except the first word.

A

Camel Case

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

also known as Upper Camel Case): This is a style where each word in a name begins with a capital letter, including the first word.

A

Pascal Case

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

(also known as Lowercase with underscores): This is a style where words within a name are separated by underscores and all letters are lowercase.

A

Snake Case

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

is a variation of snake_case, where all letters are uppercase and words are separated by underscores (_).

A

Screaming Case

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

pointers is a pointer to the current instance of a class. It is used to refer to the object within its own member functions.

A

This -> Notation

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

is an implicit pointer available within non-static member functions of a class or structure. It points to the current object instance, letting the object access its own member variables and functions.

A

This -> Notation

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

pointer can also be used as a constructor, a special member function that is called when an object of the class is created.

A

This -> Notation

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

pointer is used to refer to the object that is being created.

A

This -> Notation

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

The capability of a class to derive properties and characteristics from another class is called _________

A

Inheritance

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

is one of the most important features of Object Oriented Programming in C++

A

Inheritance

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

It allows us to create a new class (derived class) from an existing class (base class). The derived class inherits the features from the base class and can have additional features of its own.

A

Inheritance

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

if we derive a subclass from a public base class. Then the public member of the base class will become public in the derived class and protected members of the base class will become protected in the derived class.

A

Public Inheritance Mode

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

If we derive a subclass from a Protected base class. Then both public members and protected members of the base class will become protected in the derived class.

A

Protected Inheritance Mode

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

If we derive a subclass from a Private base class. Then both public members and protected members of the base class will become private in the derived class. They can only be accessed by the member functions of the derived class.

A

Private Inheritance Mode

17
Q

a class is allowed to inherit from only one class. i.e. one base class is inherited by one derived class only.

A

Single Inheritance

18
Q

is a feature of C++ where a class can inherit from more than one class. i.e one subclass is inherited from more than one base class.

A

Multiple Inheritance

19
Q

In this type of inheritance, a derived class is created from another derived class and that derived class can be derived from a base class or any other derived class. There can be any number of levels.’

A

Multilevel Inheritance