C++ Programming Concepts and Fundamentals

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

1/123

flashcard set

Earn XP

Description and Tags

A comprehensive set of 143 vocabulary flashcards covering key C++ concepts, variables, operators, program flow, formatting manipulators, formulas, and common error types based on the lecture notes.

Last updated 3:00 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

124 Terms

1
New cards

Variable

A named storage location used to hold a value.

2
New cards

Data Type

Tells C++ what kind of value a variable stores.

3
New cards

int Data Type

Stores whole numbers without decimal values.

4
New cards

double Data Type

Stores numbers that can contain decimal values.

5
New cards

bool Data Type

Stores true or false values.

6
New cards

char Data Type

Stores a single character.

7
New cards

string Data Type

Stores text or a sequence of characters.

8
New cards

Variable Declaration

Creating a variable by giving its data type and name.

9
New cards

Variable Initialization

Creating a variable and giving it an initial value.

10
New cards

Assignment

Changing the value stored in an existing variable.

11
New cards

= Operator

Assigns or stores a value in a variable.

12
New cards

== Operator

Compares two values to see if they are equal.

13
New cards

Difference Between = and ==

= assigns a value; == compares values.

14
New cards

cin

Receives input from the user.

15
New cards

cout

Displays output to the screen.

16
New cards

cin >> variable

Receives user input and stores it in the variable.

17
New cards

cout << variable

Displays the value stored in the variable.

18
New cards

cin Operator

Uses >> for input.

19
New cards

cout Operator

Uses << for output.

20
New cards

cin and cout Arrow Memory Rule

cin uses >> for input; cout uses << for output.

21
New cards

endl

Moves output to the next line.

22
New cards

Constant

A value that cannot be changed after initialization.

23
New cards

const Keyword

Creates a constant in C++.

24
New cards

Named Constants Purpose

They make code clearer and easier to update consistently.

25
New cards

Named Constant Naming Convention

Written using uppercase letters with underscores.

26
New cards

Named Constant Example

const double TAX_RATE = 0.08;

27
New cards

Regular Variable Naming Convention

Commonly named using lowercase or camelCase.

28
New cards

camelCase Example

purchasePrice

29
New cards

int price = 10;

Creates an integer variable named price with value 10.

30
New cards

double price = 12.75;

Creates a decimal variable named price with value 12.75.

31
New cards

score = 95;

Changes the existing value of score to 95.

32
New cards

score == 95

Checks whether score is equal to 95.

33
New cards
  • Operator

Adds values.

34
New cards
  • Operator

Subtracts values.

35
New cards
  • Operator

Multiplies values.

36
New cards

/ Operator

Divides values.

37
New cards

% Operator

Gives the remainder after division.

38
New cards

29 % 6

Evaluates to 55.

39
New cards

10 % 3

Evaluates to 11.

40
New cards

20 % 5

Evaluates to 00.

41
New cards

Integer Division

Division where both operands are integers and the decimal is discarded.

42
New cards

7 / 2 (Integer Division)

Evaluates to 33 when both values are int.

43
New cards

11 / 4 (Integer Division)

Evaluates to 22 when both values are int.

44
New cards

7.0 / 2

Evaluates to 3.53.5.

45
New cards

Decimal Output Condition in Division

Division produces a decimal when at least one operand is a floating-point value.

46
New cards

Operator Precedence

The rules determining which operations happen first.

47
New cards

First Step in Expression Evaluation

Parentheses occur first in an expression.

48
New cards

Second Step in Expression Evaluation

Multiplication, division, and modulus occur after parentheses.

49
New cards

Third Step in Expression Evaluation

Addition and subtraction occur after *, /, and %.

50
New cards

Equal Precedence Evaluation Order

Operations with equal precedence are evaluated from left to right.

51
New cards

5 + 3 * 4

Evaluates to 1717.

52
New cards

(10 - 4) * 2 + 3

Evaluates to 1515.

53
New cards

18 - 6 / 3 + 4 * 2

Evaluates to 2424.

54
New cards

Operator

Greater than.

55
New cards
< Operator

Less than.

56
New cards

= Operator

Greater than or equal to.

57
New cards

Less than or equal to.

58
New cards

== Relational Operator

Equal to.

59
New cards

!= Operator

Not equal to.

60
New cards

Relational Operator

An operator used to compare values.

61
New cards

&& Operator

AND; both conditions must be true.

62
New cards

|| Operator

OR; at least one condition must be true.

63
New cards

Logical Operator

An operator used to combine or work with conditions.

64
New cards

if Statement

Runs code when a condition is true.

65
New cards

else if Statement

Checks another condition if the previous condition was false.

66
New cards

else Statement

Runs when none of the previous conditions are true.

67
New cards

if (age >= 60)

Checks whether age is 60 or older.

68
New cards

choice >= 1 && choice <= 3

Means choice must be between 1 and 3 inclusive.

69
New cards

choice == 1 || choice == 2

Means choice can be either 1 or 2.

70
New cards

Boolean Condition

A condition that evaluates to true or false.

71
New cards

bool Values

Can represent true or false.

72
New cards

bool Input 1

Usually represents true or yes.

73
New cards

bool Input 0

Usually represents false or no.

74
New cards

Syntax Error

An error caused by breaking C++ grammar or syntax rules.

75
New cards

Logic Error

An error where the program runs but produces an incorrect result.

76
New cards

Missing Semicolon

A common syntax error.

77
New cards

Wrong Mathematical Formula

A type of logic error.

78
New cards

Program Compiles but Gives Wrong Answer

Classified as a logic error.

79
New cards

Code Cannot Compile Due to Invalid Syntax

Classified as a syntax error.

80
New cards

Header iostream

Header used for cin and cout.

81
New cards

Header iomanip

Header used for formatting tools.

82
New cards

using namespace std

Lets you use standard names like cin and cout without std::.

83
New cards

#include <iostream>


Provides input/output tools such as cin and cout.

84
New cards

include #include <iomanip>


Provides formatting tools such as setw and setprecision.

85
New cards

#include <string>


Provides the string data type.

86
New cards

main() Function

The function where a C++ program begins executing.

87
New cards

return 0;

Means the main function completed successfully.

88
New cards

Comment

Text ignored by the compiler that explains code.

89
New cards

Single-line Comment Start

Begins with //.

90
New cards

Comments Purpose

They explain code and make programs easier to understand.

91
New cards

fixed Stream Manipulator

Displays floating-point values in fixed decimal notation.

92
New cards

setprecision(2) with fixed

Displays exactly 2 digits after the decimal.

93
New cards

setprecision(3) with fixed

Displays exactly 3 digits after the decimal.

94
New cards

7.5 with fixed and setprecision(2)

Becomes 7.50.

95
New cards

4.2 with fixed and setprecision(3)

Becomes 4.200.

96
New cards

setw(10)

Sets a minimum field width of 10 for the next output item.

97
New cards

setw(10) Decimal Misconception

Does not mean 10 decimal places; it controls field width and spacing.

98
New cards

setw Control Scope

Controls output spacing and alignment.

99
New cards

setprecision Control Scope

Controls the number of decimal places when used with fixed.

100
New cards

left Manipulator

Aligns output to the left of its field when used with setw.