LESSON 1 & 2 Flashcards
What is C++?
C++ is a statically typed, compiled, general-purpose, case-sensitive, free-form programming language that supports procedural, object-oriented, and generic programming.
What is an algorithm?
An algorithm is a process or set of rules to be followed in calculations or problem-solving, especially by a computer.
What are the three fundamental control structures in programming?
Sequence, Selection (if-then-else), and Repetition (Looping).
What is a sequence in programming?
A sequence is a process executed from one step to another in a straightforward manner.
What is selection in programming?
Selection (if-then-else) provides a choice between two alternatives.
What is repetition in programming?
Repetition (Looping) executes a set of actions for a predefined number of times or until a condition is satisfied.
Who developed C++ and when?
Bjarne Stroustrup developed C++ in 1979 at Bell Labs.
What was C++ originally called?
C++ was originally called “C with Classes.”
When was C++ renamed from “C with Classes”?
C++ was renamed in 1983.
What is an object in C++?
An object is an instance of a class with states and behaviors.
What is a class in C++?
A class is a blueprint that defines the behaviors and states that objects of its type support.
What is a method in C++?
A method is a behavior inside a class where logic is written, data is manipulated, and actions are executed.
What is an instance variable?
An instance variable is a unique variable assigned to an object that defines its state.
What are C++ identifiers?
C++ identifiers are names used to identify variables, functions, classes, modules, or other user-defined items.
What are the rules for naming identifiers in C++?
Identifiers must start with a letter (A-Z, a-z) or an underscore (_) and can be followed by letters, underscores, and digits (0-9).
What are C++ keywords?
Keywords are reserved words in C++ that cannot be used as identifiers, such as int, float, class, return, and while.
What is whitespace in C++?
Whitespace includes spaces, tabs, newline characters, and comments, which help separate elements in a statement.
What are the two types of data types in C++?
Built-in data types and user-defined (abstract) data types.
What are examples of built-in data types in C++?
int, char, float, double.
What is an enumerated type in C++?
An enumerated type (enum) defines a new type with a sequence of named values starting from 0.
What are the four data type modifiers in C++?
long, short, signed, unsigned.
What is the difference between signed and unsigned in C++?
Signed includes both positive and negative numbers, while unsigned only allows positive numbers.
What is a variable in C++?
A variable is a named memory location that stores a value that can change during program execution.
What are the three places where variables can be declared in C++?
Inside a function (local variables), in function parameters (formal parameters), and outside all functions (global variables).
What is a local variable in C++?
A local variable is declared inside a function and can only be accessed within that function.
What is a global variable in C++?
A global variable is declared outside all functions and can be accessed by any function in the program.
What is an operator in C++?
An operator is a symbol that tells the compiler to perform mathematical or logical operations.
What are the types of operators in C++?
Arithmetic, Relational, Logical, Bitwise, Assignment, and Miscellaneous Operators.
What is the purpose of arithmetic operators?
Arithmetic operators perform mathematical operations like addition, subtraction, multiplication, and division.
What are relational operators in C++?
Relational operators compare values and include ==, !=, <, >, <=, and >=.
What do logical operators do?
Logical operators perform logical operations like AND (&&), OR (||), and NOT (!).