Glossary
Every term this course uses, defined plainly — alphabetically, and again by the week that introduces it
Appendix D — Glossary
“Whatever you do, work heartily.” — Colossians 3:23
Look it up. Then go back to the reps.
The word list for a student who has nobody to ask.
Part 1 is alphabetical — for when you know the word but not what it means. Part 2 is by week — for when you are not sure you were ever taught the thing. You will meet words in error messages before the book reaches them, so if a term says (Week 6) and you are in Week 3, you are not behind. You are early.
Terms living in only one language say C++ only or Java only. Appendix A covers OnlineGDB; Appendix C is the C++ ↔ Java translation card.
Part 1 — Alphabetical
A
abstract class / abstract method — An abstract method is a signature with no body; a class holding one is abstract and cannot be made into objects, only inherited from. C++ marks it = 0, Java abstract. (Week 6 in C++, Week 8 in Java)
accessor / mutator — A method that reads a private field (a getter) or changes one (a setter). Name mutators for what they do: deposit, check_out. (Week 5)
accumulator — A variable declared before a loop and updated inside it, so afterward it holds a result gathered across every pass: a sum, a count, a running maximum. Sums start at 0, products at 1. Declared inside the loop by mistake, it resets every pass. (Week 2)
int sum = 0;
for (int i = 1; i <= 10; i++) { sum += i; } // 55
address-of operator (&) — Gives where a variable lives rather than what is in it. C++ only. (Week 6)
AddressSanitizer — Compile with -fsanitize=address and your program reports leaks and bad memory access by line. (Week 6)
argument / parameter — The value you send at the call site, and the name the function receives it under. (Week 3)
array — A fixed-length row of same-typed slots numbered from 0. A Java array knows its own .length; a C++ array does not. (Week 3)
ArrayIndexOutOfBoundsException — Java’s complaint that you used a slot the array does not have: Index 5 out of bounds for length 5. The last valid index is one below the length, so the cure is nearly always < where you wrote <=. C++ hands you garbage instead. Java only. (Week 7)
ArrayList — Java’s growable list: .add(x), .get(i), .size(). Holds objects only. Java only. (Week 7)
arrow operator (->) / dot operator (.) — Use . on an object (m.century) and -> on a pointer, where p->name means (*p).name. (Week 4 and Week 5)
authorship block — The statement and design-decision answers submitted with each exam practical. Code you cannot explain counts as not submitted. (Week 4)
B
base class / derived class — The class inherited from, and the class doing the inheriting; parent and child, superclass and subclass. (Week 6)
boolalpha — Send it to cout once and booleans print true/false instead of 1/0. C++ only. (Week 1)
brace / value initialization — {"P52", 2, "papyrus"} fills a struct’s fields in declaration order; a bare {} sets every one to zero or empty. C++ only. (Week 4)
break / continue — break leaves the nearest loop or switch at once; continue skips the rest of the pass and rechecks the condition. (Week 2)
C
capacity vs. logical size — How many slots the array has versus how many hold data. Loops run to the count. (Week 3)
cin.ignore() — One call between a cin >> and a getline, to eat the newline the >> left in the buffer. C++ only. (Week 1)
class / object — A class is a type bundling data with the rules over it: private fields, methods as the only way in. An object is one instance of it — the class is the type, the object is the thing. (Week 5)
ClassCastException — Java’s complaint that you cast a reference to a type the object is not. Java only. (Week 7)
Comparable / Comparator — compareTo gives a type its one natural order; a Comparator supplies a different order for one call. Java only. (Week 8)
@Override
public int compareTo(Witness other) {
return Integer.compare(this.century, other.century);
}
comparison operators — ==, !=, <, <=, >, >=. Never == on two doubles — see EPSILON. (Week 2)
const — Marks a value unchangeable; assigning to it is a compile error, which is the point. Written ALL_CAPS here. C++ only. (Week 1)
const method — Promises not to modify its object: double get_balance() const. Every accessor should be one. C++ only. (Week 5)
constructor — Runs automatically when an object is created, so it is never briefly invalid. Class’s name, no return type. (Week 5)
“control reaches end of non-void function” — Some route through your function hits the closing brace without reaching a return — classically an if that returns and an else that does not. Because it is only a warning the program still builds, then hands the caller whatever garbage was lying around. Every path must end in a return. Java refuses to compile this at all. (Week 3)
D
dangling pointer — A pointer aimed at memory already freed. The address still looks real; what was there is gone, and reading through it is a use-after-free whose crash, if it comes at all, lands somewhere unrelated. Two sources: a surviving copy of a pointer you deleted, and returning the address of a local. C++ only. (Week 6)
declaration, initialization, assignment — int score; creates the variable empty; int score = 0; creates and fills it (prefer this); score = 5; changes one that already exists. One equals sign stores; two ask. (Week 1)
default constructor — One taking no arguments, required if the class’s objects will ever live in an array. (Week 5)
default method — An interface method that does have a body, built only from methods the interface requires. Java only. (Week 8)
delete / delete[] — Hands heap memory back. new pairs with delete, new[] with delete[]; match the brackets. C++ only. (Week 6)
dereference operator (*) — Before a pointer, “the value at the other end.” In int* p the same character is part of the type. C++ only. (Week 6)
destructor — Runs automatically when an object dies, named ~ClassName(). From Week 6 it frees what the object allocated. C++ only. (Week 5)
double free — Calling delete twice on one address. A leak wastes memory; this corrupts the heap. C++ only. (Week 6)
E
encapsulation — Data private and reachable only through methods, so each rule lives in one place nothing can bypass. (Week 5)
endl — Ends an output line in C++ and flushes the buffer; "\n" also works. C++ only. (Week 1)
enhanced-for loop — Java’s “for each”: for (Vehicle v : fleet). No index, no length, no off-by-one. Java only. (Week 7)
EPSILON — A tolerance you compare against instead of == on doubles. Memorize: integers and chars use ==; doubles use close-enough. (Week 2)
bool roughly_equal = (std::abs(a - b) < 0.0001);
escape sequence — \n newline, \t tab, \" a quote, \\ a backslash. (Week 1)
F
fall-through — A switch case with no break, running on into the next one. Almost always a bug. (Week 2)
final — Java’s “cannot change,” on a variable, a method, or a class. static final is Java’s const. Java only. (Week 7)
fixed and setprecision — From <iomanip>: setprecision(n) alone is significant digits, but fixed first makes it digits after the point. C++ only. (Week 1)
cout << fixed << setprecision(2) << 1234.5 << endl; // 1234.50
G
garbage collection — Java reclaiming objects nothing refers to anymore. Why Java has no delete, no destructors, and no C++-style leaks. Java only. (Week 7)
generic type / wrapper class — A type in angle brackets, ArrayList<String>, holding objects only — so you write the wrapper Integer, never int. Integer, Double, Boolean, and Character are those object forms. Java only. (Week 7)
getline — Reads a whole line including spaces. Java’s version is in.nextLine(). (Week 1)
global variable — Declared outside every function. The rule here: global const is fine, global changeable variables are forbidden. (Week 3)
guard clause — Handling the bad case first and leaving immediately, instead of wrapping the whole body in one enormous if. With three conditions the nested version is unreadable and the guarded one is still flat. (Week 3)
double safe_divide(double a, double b) {
if (b == 0.0) { return 0.0; } // bail out, then work
return a / b;
}
H
heap — Memory you request while the program runs, with new, which stays yours until you delete it (or Java’s collector takes it). Use it when the size or lifetime is not known when the program is compiled. Its opposite number is the stack. (Week 6)
I
include — Pastes a library in before compiling: <iostream>, <string>, <iomanip>, <cmath>. C++ only. (Week 1)
index / out-of-bounds — The index is the slot number reaching one element; counting starts at 0, so the last valid one is the size minus one. Go past it and C++ does not check, while Java throws. (Week 3)
infinite loop — A loop whose condition never turns false; it prints nothing and never finishes. Stop it with OnlineGDB’s Stop control — nothing is damaged — then print the loop variable at the top of the body. (Week 2)
inheritance / extends — Building one class on another so shared structure is written once. C++ writes class Car : public Vehicle, Java class Car extends Vehicle. (Week 6, Java form Week 7)
initializer list — The colon list before a C++ constructor’s body, in declaration order: Account(string n) : balance(0.0), owner(n) {}. C++ only. (Week 5)
instanceof — Java’s runtime “is this really a Car?”, followed by a cast. Its honest use is probing for an optional interface capability, not faking polymorphism. Java only. (Week 7)
integer division — 7 / 2 is 3: the fraction is thrown away, not rounded, and nothing warns you. Escape it with static_cast<double>, C++‘s explicit conversion. (Week 1)
double avg = static_cast<double>(total) / count;
interface / implements — A list of methods a class must provide, signed with implements: pure contract, no fields, no state. A class may sign as many as it likes. Java only. (Week 8)
public interface Healable {
void heal(int amount);
boolean canBeHealed();
}
J
JVM — The Java Virtual Machine, which runs your compiled Java and goes looking for main. Java only. (Week 7)
L
lexicographic order — Character-code comparison, in which every capital sorts before every lowercase letter, so "Zebra" comes before "apple". (Week 2)
linear search / selection sort — Search: walk from the start, stop when you find it, return the index or -1. Sort: find the smallest item in the unsorted remainder, swap it to the front, repeat. The swap needs a temporary. (Week 3)
linked list — Nodes, each holding a value and the address of the next, the last pointing at nullptr. No fixed ceiling, but reaching the tenth means walking ten links. (Week 6)
M
main — Where the program starts: int main() in C++, public static void main(String[] args) in Java. (Week 1)
memory leak — Heap memory you allocated and never freed, whose address nothing remembers anymore. Nothing crashes; the memory is simply gone for the life of the program. Every new needs a delete on every path out. Find them with AddressSanitizer. C++ only. (Week 6)
method — A function inside a class, working on one object whose fields it names directly. (Week 5)
modulo (%) — The remainder after integer division; 15 % 4 is 3. Whole-number types only. (Week 1)
N
namespace — Groups names so libraries do not collide; std::cout unless you write using namespace std;. C++ only. (Week 1)
new — Asks the system for heap memory and builds an object there. Every C++ new needs a delete. (Week 6 in C++, Week 7 in Java)
NoSuchElementException — A Scanner had no input left, usually an empty stdin box. Guard with if (in.hasNextLine()). Java only. (Week 7)
null pointer / nullptr — A pointer deliberately aimed at nothing. Being a known, testable value — if (p != nullptr) — is what makes it useful: functions return it for “not found,” a chain’s last node for “end.” Following one is undefined behavior and in practice an instant crash. C++ only. (Week 6)
NullPointerException — Java’s complaint that you called a method on a reference holding nothing; it names the method and the empty expression. Two usual causes: an array of objects created but never filled (new String[3] is three nulls), and a field a constructor forgot to set. Java’s null is C++‘s nullptr. Java only. (Week 7)
NumberFormatException — Java’s complaint that Integer.parseInt got something that is not a number, quoting the offending text. Java only. (Week 7)
O
object slicing — Passing a derived object by value into a base-typed parameter, which builds a fresh base-class copy and discards everything the derived class added, overrides included. No error, no warning — it quietly does the wrong thing. Take const Base& or Base* instead, and hold polymorphic collections as pointers, never values. C++ only. (Week 6)
off-by-one — A loop running one pass too many or too few: i <= 10 starting from 0 runs eleven times, not ten. (Week 2)
OnlineGDB — The free browser IDE this course runs on, at https://www.onlinegdb.com/. It compiles C++ and Java and gives the share links you submit. (Week 1)
@Override / override — The Java annotation and the C++ keyword that make the compiler verify you really are replacing a parent’s method. Without them a typo compiles cleanly and your override never runs. (Week 6 in C++, Week 7 in Java)
ownership — Which single piece of code must delete an allocation. An owning pointer frees; a borrowed one only looks. C++ only. (Week 6)
P
package-private — What you get when you write no Java access word at all. It is more open than private, not less. (Week 7)
parallel arrays — Same-length arrays where position i of each describes one thing. They drift apart silently; structs end the problem. (Week 3)
Part A / Part B — The two halves of each exam. Part A is an auto-graded Canvas quiz of code reading and tracing, 50 points, scored the moment you submit. Part B is a take-home practical, 100 points, an OnlineGDB link, open-book and AI-off on the honor system. Part B is worth twice Part A on purpose: the quiz checks that you can read code, the practical that you can write it. (Week 4)
pass by reference — Handing a function the caller’s actual variable, marked &, so changes stick. int& count is the one people forget. (Week 3)
pass by value — The default: the function gets a private copy, so changes die with the call. (Week 3)
pillars, the three — This book’s frame for everything a program does: memory (variables, structs, objects), asking questions (conditionals), and repetition (loops and functions). Every language has all three, which is why Week 7 can switch you to Java without starting over. When a concept feels strange, ask which of the three it is wearing a costume. (Week 1)
pointer — A variable whose value is the location of another variable. In C++ polymorphism is a pointer feature, which is why Week 6’s two halves are one week. C++ only. (Week 6)
int x = 42;
int* p = &x; // p holds the address of x
cout << *p; // prints 42
polymorphism — One call across many types, each answering in its own way. The declared type decides what you may call; the actual type decides what runs. (Week 6)
private / public / protected — Access levels: only this class; anyone; this class and anything derived from it. (Week 5, protected in Week 6)
prototype — A signature and a semicolon, no body, above main, so you may call the function early. C++ only. (Week 3)
pure virtual — A C++ method declared = 0 with no body, making its class abstract and obliging subclasses to supply one. C++ only. (Week 6)
R
reference (C++) — Another name for an existing variable; it cannot be null and cannot be re-aimed. (Week 3)
reference (Java) — What every class-typed variable holds: a handle to an object living elsewhere. Passing one never copies the object. (Week 7)
rep — One exercise, typed by hand and run. Every rep in exercises.txt ships with the exact output it should produce, so you can grade yourself with nobody in the room. Reading about a rep is not doing a rep. (Week 1)
return / return type — Hands a result back and ends the function. A non-void function must return on every path. (Week 3)
S
Scanner — Java’s keyboard input. This book reads every line with nextLine() and parses it, avoiding the nextInt() leftover-newline trap. Java only. (Week 7)
scope — Where a name means something. Variables die at the end of their block; parameters are local too. (Week 3)
scope resolution operator (::) — Says which class or namespace a name belongs to: Account::withdraw, std::cout. C++ only. (Week 5)
segmentation fault — The operating system stopping your program because it touched memory it does not own. You get the words and nothing else — no line number. Nine times in ten it is an index past the end of an array, or a pointer that is null, freed, or never initialized. Rebuild with -fsanitize=address and the sanitizer names the line. (Week 3)
sentinel — A value meaning “stop”: a -1 typed to end input, a nullptr ending a chain, a -1 returned for “not found.” It works only when real data can never contain it, and only helps if the caller checks. (Week 2)
shadowing — A parameter sharing a field’s name, so name = name; assigns the parameter to itself. Write this->name = name;. (Week 5)
short-circuit evaluation — && stops if the left side is false, which is exactly what makes if (d != 0 && 100 / d > 5) safe. Guard first, then use. (Week 2)
size_t — The unsigned type .length() and .find() return; comparing it with a plain int draws a -Wextra warning. C++ only. (Week 3)
stack — Where ordinary local variables live, claimed when a function starts and released when it returns, with the size known at compile time. Its opposite number is the heap. Objects leave in reverse of the order they arrived, which is why destructors fire backwards. (Week 6)
static — Belongs to the class itself, not to any one object: one shared copy. main is static, and a static method cannot touch per-object fields. Java only, in this course. (Week 7)
stream operators (<< and >>) — cout << value sends out; cin >> variable pulls in, stopping at the first space. A >> that cannot parse what it finds sets the variable to 0 and jams the stream, so every later read silently does nothing. C++ only. (Week 1)
string / String — Text in double quotes. C++ compares content with == while Java needs .equals(), and C++‘s substr(start, count) takes a length where Java’s substring(start, end) takes a stop position. (Week 1 in C++, Week 7 in Java)
string::npos — What C++‘s .find() returns for “not there,” printing as a twenty-digit number. Test against it, never against -1. C++ only. (Week 3)
struct — Bundles fields of different types under one name; note the semicolon after the closing brace. A class without rules. C++ only. (Week 4)
struct Manuscript {
string name;
int century;
string type;
};
super — Java’s parent: super(...) must be the first statement of a subclass constructor, and super.describe() calls the base version. Java only. (Week 7)
switch — Compares one whole-number or character value against fixed cases. Every case needs its own break, plus a default. (Week 2)
T
this — The object the method was called on: a pointer in C++, so ->; a reference in Java, so .. (Week 5)
tier (Normal / Medium / Hard) — Every project and both practicals ship in three versions. Normal is the standard target and the full 100 points; Medium and Hard add extra credit. Pick one before you start and drop down without shame. A finished Normal beats an abandoned Hard, every time. (Week 1)
toString() — Override it and System.out.println(obj) uses yours; skip it and you get something like Account@6d06d69c. Java only. (Week 7)
traversal — Walking every element once — an indexed for over an array, the loop below over a list. (Week 3)
Node* current = head;
while (current != nullptr) {
current = current->next;
}
truncation — Chopping a fraction off rather than rounding: 9.99 into an int is 9, with no C++ warning at all. (Week 1)
types, the five — int whole numbers, double decimals, bool/boolean true-or-false, char one character in single quotes, and string/String text in double quotes. (Week 1)
U
undeclared identifier — The compiler has never heard of a name you used. GNU g++ says 'cout' was not declared in this scope; Java says cannot find symbol. Three causes, in order: a misspelling, a missing #include or import, or use outside the block where the name lives. If it ends did you mean 'std::cout'?, you forgot using namespace std;. (Week 1)
undefined behavior — The C++ standard’s term for “the rules impose no requirement on what happens here.” A crash, a plausible wrong number, or the right answer today and a different one tomorrow are all allowed. Java prevents most of it by checking and throwing instead. (Week 3)
undefined reference — A linker error, not a compiler error: your code compiled, but something it needs is not in the finished program. In Week 1 the cause is nearly always a miscased main, and any message naming ld or collect2 belongs to this family. (Week 1)
uninitialized variable — Declared and never given a value. In C++ it holds whatever bits were at that address — it may print 0, or 73728, or something different tomorrow — and reading it is undefined behavior. A string field initializes itself; a plain number does not, which is why the braces in Manuscript m{}; matter. Java refuses to compile a read of one. (Week 1)
use-after-free — Reading or writing through a pointer whose memory was already released. The classic version is a chain destructor that deletes a node and then asks it for the next one — save next before the delete, always. C++ only. (Week 6)
V
valgrind — A Linux memory checker you will see mentioned everywhere. It does not run on Apple-Silicon Macs, so do the leak check in OnlineGDB. (Week 6)
variable — A name attached to a chunk of memory that holds a value. That sentence is the whole of Pillar 1; a pointer, a struct, and a class are all variations on it. (Week 1)
virtual — The C++ keyword turning on dynamic dispatch, so a call through a base pointer runs the derived version. Without it your override never fires. C++ only. (Week 6)
virtual destructor — Required once a class has any virtual method. Without it, delete through a base pointer runs only the base’s destructor, the derived one never fires, and everything it owned leaks — silently, every time. C++ only. (Week 6)
void — A return type meaning “this function hands nothing back.” Assigning its result to anything is a compile error. (Week 3)
W
warning vs. error — An error stops the build; a warning does not — and here the warnings are the dangerous half, including “control reaches end of non-void function” and a missing virtual destructor. Every project is graded on compiling clean under -Wall -Wextra. A warning you ignore is a bug you scheduled. (Week 1)
while loop / for loop / do…while — while checks first and repeats while the condition holds; for puts setup, condition, and step in one header, for a known number of passes; do…while checks at the bottom, so its body always runs once. (Week 2)
Part 2 — By Week
Where each term is first taught; definitions are in Part 1. A word sitting in a week ahead of you is not something you missed.
Week 1 — The Sport, and the Memory It Runs On
boolalpha, cin.ignore(), const, declaration/initialization/assignment, endl, escape sequence, fixed and setprecision, getline, include, integer division, main, modulo, namespace, OnlineGDB, pillars, rep, stream operators, string, tier, truncation, types (the five), undeclared identifier, undefined reference, uninitialized variable, variable, warning vs. error
Week 2 — Asking Questions and Doing Them Again
accumulator, break/continue, comparison operators, EPSILON, fall-through, infinite loop, lexicographic order, off-by-one, sentinel, short-circuit evaluation, switch, while/for/do…while
Week 3 — Functions and Collections
argument/parameter, array, capacity vs. logical size, “control reaches end of non-void function”, global variable, guard clause, index/out-of-bounds, linear search/selection sort, parallel arrays, pass by reference, pass by value, prototype, reference (C++), return/return type, scope, segmentation fault, size_t, string::npos, traversal, undefined behavior, void
Week 4 — Structs, and the Midterm
authorship block, brace/value initialization, dot operator, Part A / Part B, struct
Week 5 — Objects and Encapsulation
accessor/mutator, arrow operator, class/object, const method, constructor, default constructor, destructor, encapsulation, initializer list, method, private/public, scope resolution operator, shadowing, this
Week 6 — Pointers, Dynamic Memory, and Inheritance
abstract class, AddressSanitizer, address-of operator, base class/derived class, dangling pointer, delete/delete[], dereference operator, double free, heap, inheritance, linked list, memory leak, new, null pointer/nullptr, object slicing, override, ownership, pointer, polymorphism, protected, pure virtual, stack, use-after-free, valgrind, virtual, virtual destructor
Week 7 — Java and Polymorphism
ArrayIndexOutOfBoundsException, ArrayList, ClassCastException, enhanced-for loop, extends, final, garbage collection, generic type/wrapper class, instanceof, JVM, NoSuchElementException, NullPointerException, NumberFormatException, @Override, package-private, reference (Java), Scanner, static, String, super, toString()
Week 8 — Abstraction, Interfaces, the Final
abstract class/abstract method, Comparable/Comparator, default method, interface/implements
The glossary is the index card. The chapter is the gym. If three entries in a row do not land, go back to the section that taught the term and retype the program.
Coach’s Note — Keep your own file alongside this one. Every time an error costs you more than five minutes, paste in the message and the one-line fix. By Week 8 it will be worth more than this appendix, because it is indexed by the mistakes you actually make.