1/65
Comprehensive Study Guide Flashcards
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Computer Programming
The process of creating instructions for computers to perform specific tasks, generally following the Input-Process-Output (IPO) model.
A directive that tells the preprocessor to include the iostream library, which enables input/output operations in C++.
using namespace std;
Allows the use of names from the standard library without prefixing them with std:: in C++.
main() function
Every C++ program must have a main() function, which is the entry point where execution begins.
cout statement
Outputs text to the screen in C++.
endl
Adds a newline character to the output stream in C++.
return 0;
Indicates that the program has executed successfully in C++.
Program
A sequence of instructions executed by a computer.
Algorithm
A step-by-step procedure for solving a problem.
Computational Thinking
Breaking down problems into steps that a computer can execute.
Statements
Individual instructions in a program, typically ending with a semicolon (;).
Comments
Text that explains code but is ignored by the compiler; single-line comments begin with //, and multi-line comments are enclosed between /* and */.
Whitespace
Spaces, tabs, and newlines that improve code readability but are mostly ignored by the compiler.
cout
Used for output with the insertion operator (<<) in C++.
cin
Used for input with the extraction operator (>>) in C++.
endl or \n
Creates a new line in the output in C++.
Syntax Errors
Violations of the language's grammatical rules, such as missing semicolons or unmatched brackets; detected during compilation.
Logic Errors (Bugs)
The program compiles but doesn't behave as expected, for example, using < instead of <= in a condition; only found during execution or testing.
Warnings
Potential issues flagged by the compiler that are not severe enough to prevent compilation but should be addressed to avoid potential problems.
CPU
Executes machine instructions in a computer system.
Memory
Stores data and instructions in a computer system.
Storage
Permanently holds files and programs in a computer system.
Integrated Development Environment (IDE)
Combines various programming tools like a text editor, compiler, debugger, and build automation tools.
Variable
A named storage location in memory that holds a value of a specific type.
Variable Declaration
Specifies a name and a data type for a variable (e.g., int age;).
Variable Assignment
Assigns a value to a variable using the assignment operator (=) (e.g., age = 25;).
int
Integer data type, typically 4 bytes, representing whole numbers.
short
Short integer data type, typically 2 bytes, representing smaller whole numbers.
long
Long integer data type, typically 4 bytes (same as int on most systems), representing larger whole numbers.
long long
Very long integer data type, typically 8 bytes, representing very large whole numbers.
float
Single-precision floating-point data type, typically 4 bytes, representing decimal numbers with limited precision.
double
Double-precision floating-point data type, typically 8 bytes, representing decimal numbers with higher precision.
char
Character data type, typically 1 byte, representing a single character.
bool
Boolean data type, typically 1 byte, representing true or false values.
Identifiers
Names given to variables, functions, and other entities in a program; must begin with a letter or underscore, can contain letters, digits, and underscores, and cannot be a C++ keyword.
Lower Camel Case
A naming convention where the first word is lowercase, and subsequent words have a capital first letter (e.g., studentName).
Snake Case
A naming convention where all words are lowercase, and underscores separate them (e.g., student_name).
unsigned
A type modifier that modifies integer types to only represent non-negative values, doubling the positive range but eliminating negative values.
const
A keyword that creates variables whose values cannot change after initialization (e.g., const double PI = 3.14159;).
Expressions
Combine variables, constants, and operators to perform computations; evaluated according to operator precedence.
Integer Division
Truncates the result, removing any fractional part (e.g., 7 / 3 results in 2).
Modulo
Returns the remainder of a division (e.g., 7 % 3 results in 1).
Implicit Conversions
Automatic type conversions performed by the compiler in certain situations, such as assigning an int to a double.
Explicit Conversions (Casting)
Type conversions that are manually specified by the programmer using C-style casts or modern C++ cast operators like static_cast
sqrt(x)
Square root of x
pow(x, y)
x raised to power y
abs(x) or fabs(x)
Absolute value
ceil(x)
Rounds up
floor(x)
Rounds down
round(x)
Rounds to nearest
A library that provides character testing and manipulation functions.
A library provides powerful string operations.
break
A statement that immediately exits a loop.
continue
A statement that skips the rest of the current iteration and moves to the next iteration.
Arrays
Fixed size, cannot be resized after declaration
Vectors
Dynamic size, can grow or shrink as needed
Multidimensional Arrays are useful for
Representing tables, grids, or matrices
Function
A reusable block of code designed to perform a specific task.
Function Definition
A named block of code with input parameters and a return value; used to break down a program into manageable parts.
Function Call
The process of calling a function to execute its code.
Arguments/Parameters
Values passed into a function when it is called.
Return Type
The data type of the value that a function returns after execution.
Variable Scope
The scope where a variable is accessible; can be local (within a function) or global (accessible throughout the program).
Recursion
A function that calls itself; requires a base case to terminate the recursive calls.
Pass by Value
Passing a copy of the variable's value to a function.
Passing the memory address of a