Programming Fundamentals PDF Download – Kenneth Leroy Busbee BSCS

BSCS and BSIT students can read and download “Programming Fundamentals” by Kenneth Leroy Busbee, a free open textbook that teaches programming from first principles — program design, data types, control structures, functions, arrays, objects and files — with worked examples in C++ alongside C#, Java, JavaScript, Python and Swift. It began as “Programming Fundamentals: A Modular Structured Approach using C++”, Busbee’s original single-language edition, and is now published as this expanded, actively maintained 2nd edition adapted by Dave Braunschweig. The complete book is free to read online or download as a PDF from its official source.

The book is organised into eight parts that map directly onto a typical first-semester Programming Fundamentals / Intro to Programming course: how to plan a program before writing it, data and operators, functions, conditions, loops, arrays, an introduction to classes and objects, and finally strings and files. Every part ends with a full worked C++ example, so a BSCS or BSIT student following a C++-based course can read the language-neutral explanation and then see the exact same program solved in C++, without translating concepts from a Java- or Python-only textbook.

Book Overview

CourseProgramming Fundamentals / Introduction to Programming
Degree ProgramsBSCS, BSIT
LevelUniversity — first programming course, no prior programming assumed
Edition2nd Edition (published 2018)
Author(s)Kenneth Leroy Busbee (original), Dave Braunschweig (2nd edition)
Structure8 parts; every part includes a full C++ Examples page (also shown in C#, Java, JavaScript, Python, Swift) and a Practice page
LanguageEnglish
LicenseCC BY-SA 4.0 International — Model: Link-only
FormatFree online (web) and free PDF

Chapter List

Part 1: Introduction to Programming

Difficulty: Easy · Key topics: systems development life cycle, program design and quality, pseudocode, flowcharts, software testing, IDEs, version control, input/output, Hello World

The book opens with the Systems Development Life Cycle — the five-phase process of planning, analysis, design, implementation and maintenance that turns a business problem into a working program, led by a System Analyst who chooses the language and manages the build. From there it teaches how to design a solution before coding it: pseudocode for text-based logic and flowcharts (terminal, process, decision, input/output and connector symbols) for visual logic, both shown solving the same sequence, selection and iteration problems. The part explains why software testing, an IDE and version control (using Git as its example) matter to the workflow, then runs the classic Hello World program — tracing it back to Brian Kernighan’s 1974 Bell Labs memo — in C++, C#, Java, JavaScript, Python and Swift so a reader can confirm their own setup actually works.

Key Points:

  • The Systems Development Life Cycle has five phases: planning, analysis, design, implementation, maintenance.
  • Pseudocode is a text description of an algorithm’s logic; a flowchart draws the same logic with terminal, process, decision and input/output symbols.
  • Flowchart decision symbols are diamonds; process/computation symbols are rectangles; input/output symbols are parallelograms.
  • Version control (the book uses Git as its example) lets a team track, merge and roll back changes to source files.
  • The book traces its own “Hello World” example to a 1974 Bell Labs memo by Brian Kernighan, later popularised by The C Programming Language.

Practice Tip: Type the C++ “Hello World” from the book’s own C++ Examples page and run it before anything else — it confirms your compiler and editor actually work, which is the real point of the exercise.

Common Mistake: Skipping the design step (pseudocode or a flowchart) and typing code straight away — students who do this usually cannot explain why their program works when it does, and cannot debug it when it does not.

Important Questions:

  • What are the five phases of the Systems Development Life Cycle? Planning, analysis, design, implementation and maintenance — most systems cycle through them more than once as they are updated or eventually replaced.
  • What is the difference between pseudocode and a flowchart? Both describe an algorithm’s logic before coding; pseudocode is text-based structured English, while a flowchart expresses the same logic as connected symbols such as terminal, process, decision and input/output shapes.

Part 2: Data and Operators

Difficulty: Easy · Key topics: constants and variables, identifier names, data types, order of operations, arithmetic operators, integer division and modulus, data type conversions

This part defines the vocabulary every later chapter depends on. A constant is a data item whose value cannot change once the program is running; a variable is one that can, and named constants (by convention written in ALL_CAPS) must be initialised at the point they are declared. It works through five basic data types — integer, floating-point, string, boolean and “nothing” — and the naming rules for identifiers, including the camelCase, PascalCase and snake_case conventions different languages favour. The arithmetic operators (+, -, *, /, %) and compound assignment shortcuts (+=, -=, and so on) come next, with a full section explaining why integer division discards the remainder while modulus (%) returns only that remainder — the pair of operations the book itself flags as the one students confuse most.

Key Points:

  • A constant cannot change once the program starts running; a variable can.
  • Named constants must be initialised at the point they are declared; variables do not have to be.
  • The book’s five basic data types are integer, floating-point, string, boolean and “nothing” (null).
  • C++, Java and JavaScript favour camelCase; C# favours PascalCase; Python favours snake_case.
  • Integer division (/) discards the remainder; modulus (%) returns only the remainder — 11 / 4 is 2, 11 % 4 is 3.
  • Compound operators such as age += 14 are shorthand for age = age + 14.

Practice Tip: Predict the output of 14 / 4 and 14 % 4 on paper before running them — most integer-division bugs come from expecting a decimal where the language gives a truncated whole number.

Common Mistake: Confusing / and % on integers — the book’s own warning contrasts 6 / 24 (which is 0 for integers) with 6 % 24 (which is 6, the full remainder).

Important Questions:

  • What is the difference between a constant and a variable? A constant’s value cannot change during program execution, and a named constant must be given its value where it is declared; a variable’s value can change, and it does not need to be assigned one at declaration.
  • What does the modulus operator return? The remainder left over from integer division — for example, 11 % 4 is 3 because 11 / 4 leaves a remainder of 3.

Part 3: Functions

Difficulty: Medium · Key topics: modular programming, hierarchy/structure charts, parameters vs arguments, return values, scope, programming style, standard libraries

Modular programming means splitting a large program into smaller, independent, reusable functions, described here as either “program control” functions (unique to one program, subdividing its own flow) or “specific task” functions (reusable building blocks that are already coded and already tested). A parameter is the named variable a function declares in its own definition; an argument is the actual value supplied when the function is called — the book is explicit that these are two different words for two different things, not synonyms. It also covers scope (where a name is visible), the return statement and void functions that send nothing back, consistent programming style, and calling a language’s standard library instead of rewriting common operations from scratch.

Key Points:

  • Modular programming splits a program into independent, interchangeable functions instead of one long block of code.
  • The book distinguishes “program control” functions (specific to one program) from “specific task” functions (reusable across programs).
  • A parameter is the named variable in a function’s own definition; an argument is the actual value passed when the function is called.
  • Some languages (Python shown) allow named arguments, so a call like calc(celsius=37.0, fahrenheit=98.6) works regardless of order.
  • A function with a void return type performs an action but sends no value back to the caller.
  • Standard libraries provide already-tested functions so a program does not reinvent common operations.

Practice Tip: Write one function that takes a parameter and returns a value, then call it three times with three different arguments — seeing the same function body produce three different results is what makes “parameter vs argument” click.

Common Mistake: Using “parameter” and “argument” interchangeably in a written answer — the book treats them as distinct terms, and the mix-up is a common reason marks are lost on exam definitions.

Important Questions:

  • What is the difference between a parameter and an argument? A parameter is the variable identifier declared in a function’s definition; an argument is the actual value supplied to that parameter when the function is called.
  • What is the difference between a “program control” function and a “specific task” function? A program control function is specific to one program and organises that program’s own flow; a specific task function performs a common operation and is written to be reused, already coded and tested, across different programs.

Part 4: Conditions

Difficulty: Easy · Key topics: structured programming, selection control structures, if-then-else, relational and logical operators, case/switch structure

Structured programming is defined here as planning a program using only three control structures — sequence, selection and iteration — instead of unrestricted jumps that produce “spaghetti code”, an idea the book credits to Edsger Dijkstra’s work in the late 1960s. Its main structure is if-then-else, a two-way selection that runs exactly one of two mutually exclusive actions depending on whether a Boolean expression is true, including the “null else” form that does nothing when the condition is false. Relational operators build the test expressions, and logical operators (AND, OR, NOT, each shown with a worked truth table) combine several tests into one, before the case/switch structure is introduced as a cleaner alternative when a single variable is compared against many possible fixed values.

Key Points:

  • Structured programming uses exactly three control structures: sequence, selection and iteration — no unrestricted jumps.
  • if-then-else is a two-way selection: exactly one of the two actions runs, never both.
  • A “null else” — an if with no else — simply does nothing when the condition is false.
  • AND (&&/and) is true only when both sides are true; OR (||/or) is true when at least one side is true; NOT (!/not) flips a Boolean.
  • == tests equality while = assigns a value — confusing the two is called out directly as a classic bug.
  • A case/switch structure replaces a long chain of if-else-if tests when one variable is checked against many fixed values.

Memory Tip: Read if-then-else the way the book’s own example does — “if the condition holds, do this; otherwise, do that” — the two branches are always mutually exclusive, never both.

Common Mistake: Writing if (x = 5) instead of if (x == 5) — in languages where this compiles, it silently assigns 5 to x and the condition then always evaluates true.

Important Questions:

  • What are the three control structures of structured programming? Sequence (instructions run in order), selection (the program chooses between paths based on a condition) and iteration (a block of code repeats).
  • What is the difference between the AND and OR logical operators? AND returns true only when both operands are true; OR returns true when at least one operand is true.

Part 5: Loops

Difficulty: Medium · Key topics: iteration control structures, while loop, do-while loop, flag concept, for loop, nested loops, integer overflow

Iteration lets a block of code run zero, one, a fixed number, or an indefinite number of times until a condition is met, and this part works through the three main forms. A while loop tests its condition before the first pass, so its body can run zero times; a do-while loop tests after the body runs, so its body always runs at least once. A for loop is presented as shorthand for a while loop that already packages its own initialisation, test and update into one line — initialise a counter, test it, run the body, update the counter, repeat — and the book is explicit that forgetting the update step is exactly what creates an infinite loop. It also introduces the flag concept (a Boolean variable used to signal that a loop should stop) and nested loops, where an inner loop runs to completion for every single pass of the outer loop.

Key Points:

  • A while loop tests its condition before the body runs, so the body can execute zero times.
  • A do-while loop tests its condition after the body runs, so the body always executes at least once.
  • A for loop packages initialisation, test and update into one line and is chosen when the number of iterations is known in advance.
  • Forgetting the update/increment step inside a loop is the book’s own named cause of an infinite loop.
  • A flag is a Boolean variable set inside a loop to signal, on a later check, that the loop should stop.
  • In a nested loop, the inner loop runs to completion for every single pass of the outer loop.

Practice Tip: Rewrite one for loop as an equivalent while loop by hand — moving the initialisation above the loop and the update to the end of the body is exactly what a for loop is shorthand for.

Common Mistake: Leaving out the increment/update statement, or updating the wrong variable, inside a while loop — the book names this directly as the standard cause of an infinite loop.

Important Questions:

  • What is the difference between a while loop and a do-while loop? A while loop checks its condition before running the body, so the body may run zero times; a do-while loop checks after running the body, so the body always runs at least once.
  • What causes an infinite loop in a counting loop, and how is it avoided? Omitting or misplacing the update (increment/decrement) statement so the test condition never becomes false; every counting loop needs initialisation, a test, and an update that actually changes the value being tested.

Part 6: Arrays

Difficulty: Medium · Key topics: arrays and lists, index notation, searching, sorting, parallel arrays, multidimensional arrays, fixed vs dynamic arrays

An array is defined as a data structure holding a collection of elements under one identifier name, each reachable by an index — a one-dimensional array is called a list, a two-dimensional array a table, and the book’s own worked example (ages = [49, 48, 26, 19, 16]) makes explicit that indexing always starts at 0, so ages[0] is 49, not ages[1]. It then covers finding values with linear search, which steps through the array comparing each element in turn, demonstrated by finding the maximum and minimum of that same ages array. Rather than teaching sort algorithms from first principles, the sorting section shows that every language in the book ships a built-in sort — sort() in C++, Arrays.sort() in Java, .sort() in Python — and recommends using it instead of writing one by hand. The part closes with parallel arrays (matching index positions across two or more arrays to represent related fields), multidimensional arrays, and the distinction between a fixed-size array and a dynamic one.

Key Points:

  • An array holds a collection of elements under one identifier name, each accessed by an index.
  • Array indexing starts at 0: in ages = [49, 48, 26, 19, 16], ages[0] is 49, not ages[1].
  • A one-dimensional array is a “list”; a two-dimensional array is a “table”.
  • Linear search steps through an array element by element, comparing each one to the target — the book demonstrates it by finding an array’s maximum and minimum.
  • Nearly every language in the book has a built-in sort (C++’s sort(), Java’s Arrays.sort(), Python’s .sort()), which the book recommends over hand-writing a sort algorithm.
  • Parallel arrays use matching index positions across two or more arrays to represent related fields for the same record.

Practice Tip: Print every index alongside its value in a loop (for example for i in range(len(ages)): print(i, ages[i])) the first time you touch a new array — it fixes the habit of assuming the first element sits at index 1.

Common Mistake: Assuming the first array element is at index 1 instead of index 0, which shows up as an off-by-one error the first time a loop runs one step too far or falls one short.

Important Questions:

  • Why does ages[0] refer to the first element of ages = [49, 48, 26, 19, 16]? Because array indexing starts at 0 in every language the book covers, so the first element sits at index 0 and the last of five elements sits at index 4, not 5.
  • What is a parallel array? One of two or more arrays that share the same index positions, so that, for example, names[i] and ages[i] describe the same person’s name and age at the same index i.

Part 7: Objects and Classes

Difficulty: Medium · Key topics: classes, objects, encapsulation, inheritance, polymorphism

This part introduces object-oriented programming: a class is a blueprint that bundles related data (attributes) and the functions that act on that data (methods) into a single definition, and an object is one instance of that class created at run time. Encapsulation is the practice of keeping an object’s internal data private and exposing only the methods needed to work with it, so the object controls how its own state can change. Inheritance lets a new class be based on an existing one and reuse its implementation, expressed through an “is-a” relationship — the part’s own running example bases Instructor and Student classes on a shared Person class. Polymorphism, demonstrated with that same Person hierarchy, is the ability to write one function that accepts a Person parameter and have it work correctly whether it is actually handed an Instructor or a Student object, because both are also a Person.

Key Points:

  • A class is a blueprint bundling data (attributes) and behaviour (methods); an object is one instance of a class created while the program runs.
  • Encapsulation keeps an object’s data private and exposes only the methods needed to use it, so the object protects its own state.
  • Inheritance lets a class reuse another class’s implementation, identified by an “is-a” relationship (an Instructor “is a” Person).
  • The book’s Person → Instructor / Student hierarchy is the running example for both inheritance and polymorphism.
  • Polymorphism means a single interface — one function taking a Person — works correctly for any subclass of Person passed to it.
  • This part repeats the same worked class example in C++, C#, Java, JavaScript, Python and Swift so the OOP syntax can be compared side by side.

Memory Tip: Read inheritance as “is-a” and encapsulation as “protects its own data” — an Instructor is-a Person (inheritance) but keeps its own grade data private (encapsulation).

Common Mistake: Treating inheritance and polymorphism as the same idea because both use the same Person/Instructor/Student example — inheritance is about reusing an implementation, polymorphism is about one interface working across several different types.

Important Questions:

  • What is the difference between a class and an object? A class is the blueprint that defines what attributes and methods a thing has; an object is an actual instance of that class created and used while the program runs.
  • What does it mean for Instructor and Student to inherit from Person? They reuse Person’s shared implementation through an “is-a” relationship and add their own specialised attributes and methods on top of it, so common functionality is written once in Person instead of twice.

Part 8: Strings and Files

Difficulty: Medium · Key topics: strings, string functions, string formatting, file input and output

A string is defined here as a sequence of characters treated as a literal constant or a variable, stored internally as a kind of one-dimensional character array; modern languages manage a string’s length and memory automatically, which is why the buffer-overflow bugs that plagued older C-style string handling are far less common today. The part works through the string toolkit shared across languages — case conversion, comparison, concatenation, find, join, length, replace, reverse, split, substring and trim — each shown in C++, C#, Java, JavaScript, Python and Swift. It closes with file input and output as four operations: open (which needs at least a path and a mode — read, write or append), read, write and close, noting that closing a file both frees the operating system’s resources and flushes any buffered writes to disk, and that some languages provide a “using”/”with” wrapper that closes a file automatically.

Key Points:

  • A string is a sequence of characters, stored internally like a one-dimensional array of characters.
  • Concatenation combines two strings into one, usually with + or +=.
  • The book’s shared string toolkit includes case conversion, comparison, find, join, length, replace, reverse, split, substring and trim, in every language it covers.
  • Opening a file needs at least two arguments: the file path and a mode — read, write, append, or a combination.
  • Closing a file both releases the operating system’s resources and flushes any buffered write data to disk.
  • Some languages provide a using/with wrapper (shown for C# and Python) that closes a file automatically, even if an error occurs.

Practice Tip: Always close a file you opened for writing — or use your language’s using/with wrapper — and check what happens to your output if you forget: unflushed data can simply be missing from the file.

Common Mistake: Forgetting to close a file after writing to it, so the last buffered write never reaches disk and the file looks incomplete or empty even though the program “ran successfully.”

Important Questions:

  • What two arguments does opening a file need at minimum? The file’s path and a mode that says how it will be used — read, write, append, or some combination of those.
  • Why does closing a file matter even after all the writes are done? Closing releases the operating system resources tied to the open file and flushes any data still sitting in the program’s write buffer to disk, so skipping it can leave the file’s last writes missing.

Download Programming Fundamentals PDF (Free)

This book is free from its official source at Rebus Press. Click below to open the official page, where the complete book can be read online part by part or downloaded as a single PDF.

↓ Download PDF

How to Study This Book

Read the eight parts in the order the book gives them — Introduction to Programming, Data and Operators, Functions, Conditions, Loops, Arrays, Objects and Classes, and Strings and Files — because each part leans on vocabulary and structures the one before it just defined. Skipping ahead to Functions before finishing Data and Operators is the single most common way students get stuck in this book, since parameters and return values only make sense once you are already comfortable with data types and expressions.

For a one-semester Programming Fundamentals / Intro to Programming course, Parts 1 through 6 (Introduction, Data and Operators, Functions, Conditions, Loops, Arrays) are the actual syllabus at most Pakistani universities and should be read in full, including every part’s own C++ Examples page. Part 7 (Objects and Classes) is normally the first two or three weeks of a separate Object-Oriented Programming course rather than this one — read it here only as a preview, and move to a dedicated OOP book once your own course reaches inheritance and polymorphism in depth.

Do not read a part’s chapters and skip its “C++ Examples” page. The prose explains a concept once in language-neutral terms; the C++ Examples page is where that concept becomes the exact syntax you will be graded on, and working through it is the fastest way to confirm you actually understood the chapter rather than just recognised the words.

Part 5 (Loops) and Part 6 (Arrays) are where most first-semester students lose marks, because loop bugs (forgetting the update step, an off-by-one index) rarely show up as compiler errors — they show up as wrong output. Type every loop and array example from these two parts yourself instead of only reading them; tracing the loop counter and the array index by hand, iteration by iteration, is the single most useful habit this book can build.

The book never teaches recursion, pointers, dynamic memory management, templates, the Standard Template Library, or advanced OOP topics such as abstract classes and interfaces — it deliberately stops at the level a first Programming Fundamentals course needs. If your own syllabus goes beyond Part 8 (Strings and Files), you will need a second book for the rest of the semester; Object Oriented Programming Using C++ is the natural next step for a BSCS student once this course ends.

Every part ends with its own Practice page and exercises, separate from the numbered chapters. Work through a part’s Practice page before moving to the next part — the exercises are written directly against that part’s own material and are the closest thing this book has to past-paper-style questions.


Used In These Programs

This book is used for the Programming Fundamentals course in: BS Computer Science · BS Information Technology. Browse all Programming books or all Computer Science books.

Who Should Read This

Programming Fundamentals is written for a genuine first-time programmer — it opens with the systems development life cycle and pseudocode before a single line of code appears, and its data types chapter treats “integer” and “string” as new vocabulary rather than a refresher. That makes it a strong fit for the first semester of BSCS and BSIT, whichever language your own course leads with, since every part’s ideas are explained once and then shown in C++, C#, Java, JavaScript, Python and Swift side by side. It is not the right book once your course moves into object-oriented design in depth: Part 7 covers only the basics of classes, encapsulation, inheritance and polymorphism in a handful of pages, and a BSCS student should move on to a dedicated title like Object Oriented Programming Using C++ once inheritance and polymorphism become the actual syllabus rather than a preview.


Applicable Universities

This book is useful for students at Pakistani universities offering BSCS and BSIT including Punjab University, Virtual University, COMSATS, FAST, UET, NUST, and other HEC-recognized institutions.

FAQs

Is Programming Fundamentals by Kenneth Busbee free?

Yes. It is released under the Creative Commons Attribution-ShareAlike 4.0 International licence, and the complete book is free to read online or download as a PDF from its official Rebus Press page.

Which edition is this?

The 2nd edition, published in 2018 and adapted by Dave Braunschweig from Kenneth Busbee’s original C++-only 1st edition. It is the actively maintained, currently hosted edition, which is why we link to it instead of an older mirror.

How many chapters does it have?

The book is organised into 8 parts — Introduction to Programming, Data and Operators, Functions, Conditions, Loops, Arrays, Objects and Classes, and Strings and Files — each broken into short topic pages, a full worked C++ Examples page, and a Practice page with exercises.

Is it good for complete beginners?

Yes, genuinely. It opens with the systems development life cycle and pseudocode before writing any code, and explains basic terms like data types and variables from zero rather than assuming prior programming knowledge.

Does it cover C++ specifically, or just theory?

Both. Every one of the 8 parts explains its concepts in language-neutral terms and then includes a full worked C++ Examples page showing the exact same program, alongside the same example in C#, Java, JavaScript, Python and Swift.

Does it cover object-oriented programming (classes, inheritance)?

Only the basics, in Part 7 (Objects and Classes) — classes, objects, encapsulation, inheritance and polymorphism are introduced but not covered in depth. Students should move to a dedicated Object-Oriented Programming book once their course reaches those topics in full.

Related Books

Programming Fundamentals gives BSCS and BSIT students a complete, honestly beginner-friendly first course in programming, with the same eight-part logic explained once and then shown working in six languages including C++. Read Parts 1 through 6 in order for a standard Programming Fundamentals course, and move to a dedicated Object-Oriented Programming book once your syllabus goes past Part 7. Browse more Computer Science books for the rest of your semester.

Programming Fundamentals by Kenneth Leroy Busbee, 2nd Edition adapted by Dave Braunschweig. Copyright © 2018 by the authors and contributors. Free under the Creative Commons Attribution-ShareAlike 4.0 International licence. Official source: https://press.rebus.community/programmingfundamentals/

Leave a Comment