C++ Looping and File Operations Review

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/70

flashcard set

Earn XP

Description and Tags

These flashcards cover vocabulary related to increment and decrement operators, loops, and file input/output in C++, aiding in reinforcing key concepts for the exam.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

71 Terms

1
New cards

Increment Operator

An operator (++) that adds 1 to its operand.

2
New cards

Decrement Operator

An operator (--) that subtracts 1 from its operand.

3
New cards

Postfix Mode

When the increment/decrement operator is placed after the variable (e.g., num++).

4
New cards

Prefix Mode

When the increment/decrement operator is placed before the variable (e.g., ++num).

5
New cards

While Loop

A loop that iterates as long as a specified condition is true.

6
New cards

Do-While Loop

A posttest loop that executes at least once before checking its condition.

7
New cards

For Loop

A loop designed for count-controlled iterations with initialization, test, and update expressions.

8
New cards

Loop Control Variable

A variable that determines how many times a loop iterates.

9
New cards

Accumulator

A variable used to maintain a running total.

10
New cards

Sentinel Value

A special value used to mark the end of a list of values.

11
New cards

Input Validation

The process of ensuring that user input is valid before processing.

12
New cards

Semi-colon in Loop

Should not be placed after the loop header, as it can terminate the loop prematurely.

13
New cards

Infinite Loop

A loop that never terminates due to a failure to meet a stopping condition.

14
New cards

Nested Loop

A loop that exists within another loop.

15
New cards

File Stream

An object that handles reading from and writing to files.

16
New cards

ofstream

Output file stream used for writing data to files.

17
New cards

ifstream

Input file stream used for reading data from files.

18
New cards

fstream

File stream that can be used for both input and output operations.

19
New cards

Open a File

To create a link between a file and a file stream object.

20
New cards

Close a File

To end the connection between a file stream object and a file.

21
New cards

Text File

A file that contains data encoded as text.

22
New cards

Binary File

A file that contains data in binary format that is not readable as text.

23
New cards

Sequential Access

Accessing data in a file in the order it is stored, from beginning to end.

24
New cards

Random Access

Accessing data in a file directly without reading through it sequentially.

25
New cards

Read Position

The internal marker indicating where the next data read operation will occur in a file.

26
New cards

Break Statement

Causes an immediate exit from a loop.

27
New cards

Continue Statement

Skips the current iteration of a loop and continues with the next iteration.

28
New cards

Variable Declaration

Defining a variable in a program before it is used.

29
New cards

Test Expression

A condition that determines if a loop continues to execute.

30
New cards

Initialization Expression

The expression that initializes the loop counter variable.

31
New cards

Update Expression

The expression that updates the counter variable at the end of each iteration.

32
New cards

Count-Controlled Loop

A loop where the number of iterations is known beforehand.

33
New cards

Conditional Loop

A loop that continues to execute as long as a condition remains true.

34
New cards

Priming Read

Initial read operation that provides the first value for a loop condition.

35
New cards

Loop Header

The first line of a loop definition containing loop control expressions.

36
New cards

Echoing Data

Displaying data that has been read from a file.

37
New cards

File Operations

The actions of opening, processing, and closing files in programming.

38
New cards

User-Controlled Loop

A loop where the user dictates how many times the loop will run.

39
New cards

C++ Standard Library

A collection of classes and functions provided with the C++ language for standard tasks.

40
New cards

Flow Control

The order in which individual statements, instructions, or function calls are executed in a program.

41
New cards

Stream Manipulators

Functions that modify how data is formatted in input/output operations.

42
New cards

Whitespace Characters

Characters such as spaces, tabs, and newlines that are used in formatting.

43
New cards

Escape Sequence

A sequence of characters that signifies a special character in a string.

44
New cards

Function Prototype

Declaration of a function that specifies its name, parameters, and return type.

45
New cards

Logic Error

An error in a program that produces incorrect results but does not cause the program to crash.

46
New cards

Control Structure

A block of code that determines the flow of execution of a program.

47
New cards

Compiler

A program that translates code written in a programming language into machine code.

48
New cards

Code Readability

How easily a human reader can understand the written code.

49
New cards

Variable Scope

The area of the program in which a variable is defined and can be accessed.

50
New cards

Debugging

The process of finding and fixing errors in code.

51
New cards

Symbolic Constants

Named constants used in programming to improve code readability.

52
New cards
53
New cards
54
New cards
55
New cards
56
New cards
57
New cards
58
New cards
59
New cards
60
New cards
61
New cards
62
New cards
63
New cards
64
New cards
65
New cards
66
New cards
67
New cards
68
New cards
69
New cards
70
New cards
71
New cards