C++ Programming Reviewer Flashcards

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/23

flashcard set

Earn XP

Description and Tags

Flashcards covering fundamental topics in C++ programming including algorithms, control structures, data types, operators, and execution steps.

Last updated 12:27 AM on 9/29/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

24 Terms

1
New cards

What is an algorithm?

A step-by-step list of instructions to solve a problem that is clear, finite, ordered, and gives a correct output.

2
New cards

What is pseudocode?

An algorithm written in plain English that looks like code. It is not real code, has no strict syntax rules, and cannot be run.

3
New cards

What are the four primary flowchart shapes and their meanings?

Oval means Start / End, Parallelogram means Input / Output, Rectangle means Process (calculation), and Diamond means Decision (yes/no).

4
New cards

What are the three control structures used by every algorithm?

Sequence (steps run one after another), Selection (choose a path with if/else), and Repetition (repeat steps using loops).

5
New cards

Who created C++, and what is its origin?

C++ was created by Bjarne Stroustrup as an extension of the C programming language.

6
New cards

What is the function of a compiler in C++?

A compiler translates source code (saved as .cpp) into machine language (0s and 1s).

7
New cards

What is a preprocessor directive in C++?

Lines starting with # (such as #include ) that are processed before compilation to prepare the code.

8
New cards

What is the main function in C++?

The starting point of every C++ program where execution always begins, written as int main() and returning 0 upon successful completion.

9
New cards

What are the four main pillars of Object-Oriented Programming (OOP)?

Encapsulation, Inheritance, Polymorphism, and Abstraction.

10
New cards

What are the key differences between Structured Programming and Object-Oriented Programming?

Structured focuses on functions, uses a top-down approach, and has separate data with less security. OOP focuses on objects, uses a bottom-up approach, bundles data with functions in classes, and provides data hiding (encapsulation) and high reuse.

11
New cards

What rules must C++ identifiers follow?

They can contain only letters, digits, and underscores; cannot start with a digit; cannot contain spaces or special symbols; cannot be keywords; and are case-sensitive.

12
New cards

What is the difference between char and string literals in C++?

char represents a single character enclosed in single quotes (e.g., 'A'), whereas string represents a group of characters enclosed in double quotes (e.g., "A").

13
New cards

What are the typical sizes and data types used in C++?

int (44 bytes) for whole numbers, float (44 bytes) for decimals, double (88 bytes) for precise decimals, char (11 byte) for one character, bool (11 byte) for true/false, string (varies) for text, and void for no value.

14
New cards

What is the difference between variable declaration and initialization?

Declaration tells the compiler the variable's data type and name (e.g., int age;). Initialization gives the variable its first value (e.g., int age = 18;).

15
New cards

How do pre-increment (++x) and post-increment (x++) operations differ?

Pre-increment (++x) adds 11 to the variable first and then uses the new value. Post-increment (x++) uses the current value first and then adds 11 to the variable.

16
New cards

How does integer division behave in C++ compared to floating-point division?

Integer division drops the decimal part (e.g., 7/2=37 / 2 = 3). For a decimal result, at least one operand must be a double or float (e.g., 7.0/2=3.57.0 / 2 = 3.5).

17
New cards

What is the difference between the '=' and '==' operators?

The '=' symbol is an assignment operator used to store a value in a variable, while '==' is a relational operator used to compare two values.

18
New cards

What is the operator precedence order from highest to lowest in C++?

  1. ( ) 2. ++ -- ! unary - 3. * / % 4. + - 5. <
19
New cards

How is the mathematical expression a+b2\frac{a + b}{2} written as a valid C++ expression?

(a + b) / 2

20
New cards

What is the hierarchy of implicit type conversion (promotion) in mixed expressions?

char -> int -> float -> double

21
New cards

What is a requirement when declaring a constant using the 'const' keyword?

A const variable must be initialized with a value at the time it is declared, and its value cannot be changed later.

22
New cards

Which operators are used with standard input (cin) and standard output (cout)?

cout uses the insertion operator (<

23
New cards

What are the five steps to create a C++ program?

  1. Write source code (.cpp), 2. Preprocess, 3. Compile, 4. Link, 5. Execute / Run.
24
New cards

What are the three types of programming errors in C++?

  1. Syntax error (breaks language rules, caught by compiler), 2. Runtime error (causes the program to crash while running), 3. Logic error (program runs, but produces incorrect output).