Flashcards: Introduction to C++ and OOP — 48 cards

All cards

1Question

Who created C++ and when?

Answer

Bjarne Stroustrup created C++ in 1985.

2Question

Where was C++ created?

Answer

At Bell Labs.

3Question

What programming paradigms does C++ combine?

Answer

Object-oriented, generic, and procedural programming.

4Question

What performance and memory features does C++ offer?

Answer

Near-assembly performance and manual memory control.

5Question

Name three application areas where C++ is used.

Answer

Operating systems, compilers, and games.

6Question

How are programming languages classified by abstraction?

Answer

As machine, assembly, low-level, mid-level, high-level, and very high-level languages.

7Question

Which programming paradigms are commonly recognized?

Answer

Procedural, object-oriented, functional, scripting, declarative, and logic programming.

8Question

In which year was C++ introduced?

Answer

1985.

9Question

When was the C programming language introduced?

Answer

1972.

10Question

What year was Python introduced?

Answer

1991.

11Question

When was Java introduced?

Answer

1995.

12Question

What are the main stages in the program development cycle?

Answer

Problem definition, algorithm design, coding, testing and debugging, and documentation.

13Question

What does problem definition identify in program development?

Answer

Requirements, inputs, outputs, and constraints.

14Question

What is produced by problem definition in program development?

Answer

A problem statement.

15Question

What tools are used in algorithm design before coding?

Answer

Flowcharts and pseudocode.

16Question

What is the purpose of algorithm design in program development?

Answer

To produce an algorithm before coding begins.

17Question

What does a compiler do with high-level source code?

Answer

It translates it into machine code.

18Question

What is the first step in C++ compilation from .cpp files?

Answer

Preprocessing from .cpp to .i files.

19Question

What is the main function of a linker in program building?

Answer

It combines object files and resolves external references.

20Question

How does a loader differ from a linker?

Answer

It places the executable in memory and starts it.

21Question

What happens during static linking?

Answer

Libraries are copied into the executable.

22Question

What characterizes dynamic linking?

Answer

Libraries are loaded at runtime requiring DLL or .so files.

23Question

What is a variable in C++?

Answer

A named storage location in memory that holds a changeable value.

24Question

What must a C++ variable name start with?

Answer

A letter or underscore.

25Question

Where is a local variable declared in C++?

Answer

Inside a function or block.

26Question

Where is a global variable declared in C++?

Answer

Outside all functions.

27Question

Which primitive C++ types are 4 bytes in size?

Answer

int and float.

28Question

How many bytes does a double type occupy in C++?

Answer

8 bytes.

29Question

What size do char and bool types have in C++?

Answer

1 byte each.

30Question

What does procedural programming focus on compared to object-oriented programming?

Answer

Procedural programming focuses on functions and separates data from functions.

31Question

How does object-oriented programming handle data and methods?

Answer

It combines data and methods in objects.

32Question

What are the four core principles of object-oriented programming?

Answer

Encapsulation, inheritance, polymorphism, and abstraction.

33Question

What does encapsulation do in object-oriented programming?

Answer

It binds data and methods together while hiding internal implementation details.

34Question

What is a class in programming?

Answer

A user-defined data type encapsulating data and functions as a blueprint without allocating memory.

35Question

What defines an object in programming?

Answer

An instance of a class that occupies memory and can be manipulated.

36Question

How is a member function defined inside a class treated by default?

Answer

It is inline by default.

37Question

What distinguishes a member function defined outside a class?

Answer

It separates interface from implementation using the scope-resolution operator.

38Question

What does the dot operator do in object access?

Answer

It accesses members through an object.

39Question

How does the arrow operator access members?

Answer

Through a pointer to an object, equivalent to (*pointer).member.

40Question

What happens to objects allocated on the stack?

Answer

They are destroyed automatically.

41Question

What must be done for objects allocated on the heap with new?

Answer

They require a matching delete to prevent memory leaks.

42Question

What does an access specifier define in C++?

Answer

It defines visibility and accessibility of class members.

43Question

From where are public members accessible in C++?

Answer

Inside the class, derived classes, and outside the class.

44Question

Where are protected members accessible in C++?

Answer

Inside their class and derived classes only.

45Question

Can protected members be accessed from outside their class?

Answer

No, they cannot be accessed from outside the class.

46Question

Where are private members accessible in C++?

Answer

Only inside their own class.

47Question

What is the default access specifier in a C++ class?

Answer

Private is the default access specifier in a class.

48Question

What is the default access specifier in a C++ struct?

Answer

Public is the default access specifier in a struct.

Test yourself with the quiz

Test your knowledge with 23 questions on Introduction to C++ and OOP.

1. Who created C++ at Bell Labs in 1985 as an extension of C with object-oriented features?

2. Which combination best characterizes C++ as a programming language?

Take the quiz →

Read the study sheet

Review the complete course in the study sheet for Introduction to C++ and OOP.

See study sheet →

Similar courses

Create your own flashcards

Import your course and AI generates flashcards in 30 seconds.

Flashcard generator