LESSON 1 & 2 Flashcards

1
Q

What is C++?

A

C++ is a statically typed, compiled, general-purpose, case-sensitive, free-form programming language that supports procedural, object-oriented, and generic programming.

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

What is an algorithm?

A

An algorithm is a process or set of rules to be followed in calculations or problem-solving, especially by a computer.

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

What are the three fundamental control structures in programming?

A

Sequence, Selection (if-then-else), and Repetition (Looping).

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

What is a sequence in programming?

A

A sequence is a process executed from one step to another in a straightforward manner.

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

What is selection in programming?

A

Selection (if-then-else) provides a choice between two alternatives.

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

What is repetition in programming?

A

Repetition (Looping) executes a set of actions for a predefined number of times or until a condition is satisfied.

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

Who developed C++ and when?

A

Bjarne Stroustrup developed C++ in 1979 at Bell Labs.

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

What was C++ originally called?

A

C++ was originally called “C with Classes.”

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

When was C++ renamed from “C with Classes”?

A

C++ was renamed in 1983.

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

What is an object in C++?

A

An object is an instance of a class with states and behaviors.

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

What is a class in C++?

A

A class is a blueprint that defines the behaviors and states that objects of its type support.

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

What is a method in C++?

A

A method is a behavior inside a class where logic is written, data is manipulated, and actions are executed.

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

What is an instance variable?

A

An instance variable is a unique variable assigned to an object that defines its state.

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

What are C++ identifiers?

A

C++ identifiers are names used to identify variables, functions, classes, modules, or other user-defined items.

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

What are the rules for naming identifiers in C++?

A

Identifiers must start with a letter (A-Z, a-z) or an underscore (_) and can be followed by letters, underscores, and digits (0-9).

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

What are C++ keywords?

A

Keywords are reserved words in C++ that cannot be used as identifiers, such as int, float, class, return, and while.

17
Q

What is whitespace in C++?

A

Whitespace includes spaces, tabs, newline characters, and comments, which help separate elements in a statement.

18
Q

What are the two types of data types in C++?

A

Built-in data types and user-defined (abstract) data types.

19
Q

What are examples of built-in data types in C++?

A

int, char, float, double.

20
Q

What is an enumerated type in C++?

A

An enumerated type (enum) defines a new type with a sequence of named values starting from 0.

21
Q

What are the four data type modifiers in C++?

A

long, short, signed, unsigned.

22
Q

What is the difference between signed and unsigned in C++?

A

Signed includes both positive and negative numbers, while unsigned only allows positive numbers.

23
Q

What is a variable in C++?

A

A variable is a named memory location that stores a value that can change during program execution.

24
Q

What are the three places where variables can be declared in C++?

A

Inside a function (local variables), in function parameters (formal parameters), and outside all functions (global variables).

25
Q

What is a local variable in C++?

A

A local variable is declared inside a function and can only be accessed within that function.

26
Q

What is a global variable in C++?

A

A global variable is declared outside all functions and can be accessed by any function in the program.

27
Q

What is an operator in C++?

A

An operator is a symbol that tells the compiler to perform mathematical or logical operations.

28
Q

What are the types of operators in C++?

A

Arithmetic, Relational, Logical, Bitwise, Assignment, and Miscellaneous Operators.

29
Q

What is the purpose of arithmetic operators?

A

Arithmetic operators perform mathematical operations like addition, subtraction, multiplication, and division.

30
Q

What are relational operators in C++?

A

Relational operators compare values and include ==, !=, <, >, <=, and >=.

31
Q

What do logical operators do?

A

Logical operators perform logical operations like AND (&&), OR (||), and NOT (!).