Skip to content

Programming by Design

If you're not prepared to be wrong, you'll never come up with anything original. – Sir Ken Robinson

  • About
  • Java-PbD
  • C-PbD
  • ASM-PbD
  • Algorithms
  • Other

Author: William Jojo

Chapter 5 – Iterative Control Structures

Posted on August 11, 2019November 21, 2024 By William Jojo
C book

Updated November 21, 2024 Table of contents Overview The while loop Range-based or Counter-based loop Sentinel-based loop Flag-based loop EOF-based loop The for loop The do-while loop The break and continue statements Nested Loops File Handling Safely Reading Numbers – Part III Building a Command Line Interface (CLI) Exercises Overview There is a clear need … Read More “Chapter 5 – Iterative Control Structures” »

Chapter 4 – Conditional Control Structures

Posted on August 11, 2019November 21, 2024 By William Jojo
C book

(Updated November 21, 2024) Table of contents Relational Operators One-way and two-way selection Compound Statements Multi-way selection The Dangling else Logical Operators The switch Statement Short-circuit Evaluation The ternary operator ?: Safely Reading Numbers – Part II Exercises Relational Operators Up to this point, our statements have been executed sequentially; they have been processed in … Read More “Chapter 4 – Conditional Control Structures” »

Chapter 3 – Input and Output

Posted on August 11, 2019November 21, 2024 By William Jojo
C book

(Updated November 21, 2024) Table of contents Basic User Output Basic User Input Strings Revisited Comparing Strings Searching Strings Duplicating Strings Introduction to Storage Classes Advanced Output With the printf() Function Input with the scanf() and fgets() Functions Safely Reading Numbers – Part I Random Numbers Quiz Exercises Basic User Output Here we will introduce … Read More “Chapter 3 – Input and Output” »

Chapter 2 – Elements of the C Language

Posted on August 11, 2019January 20, 2025 By William Jojo
C book

(Updated November 21, 2024) Table of contents Overview Components of the Language Data Types Using void and bool Arithmetic Operators and Precedence Constants, Literals, Variables, and const Strings Basic Input/Output Escape Increment, Decrement and Comments The main Function Quiz Exercises Overview This is an extensive chapter. Many components of the C programming language are presented … Read More “Chapter 2 – Elements of the C Language” »

Java Exercise Answers

Posted on August 10, 2019August 26, 2020 By William Jojo
Java Book

(Updated August 26, 2020) Table of contents Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Chapter 7a Chapter 7b Chapter 8 Chapter 9 Chapter 9s Chapter 10 Chapter 11 Chapter 12 Chapter 13 Chapter 14 Chapter 15a Chapter 15b Chapter 16 Chapter 17 Chapter 18 Chapter 1 [Note: There are no … Read More “Java Exercise Answers” »

new code

Posted on July 5, 2019January 11, 2021 By William Jojo
Uncategorized

import java.util.*; // Class definition public class methods { // Scanner class for read user input. static Scanner kb = new Scanner(System.in); // main method. This is where it all starts. public static void main(String[] args) { // Declaraions – variables double x, y, square; // Output statements in the form of method calls to … Read More “new code” »

Chapter 1 – The C Environment

Posted on June 6, 2019November 21, 2024 By William Jojo
C book

(Updated November 21, 2024) Table of contents Programming Environment The C Language The C runtime The C Standard(s) Final Thoughts About This Book Quiz Exercises Programming Environment The C programming language makes it easy to develop programs using a simple and modest set of language constructs. The C language is a subset of C++. C++ … Read More “Chapter 1 – The C Environment” »

Chapter 18 – Trees

Posted on June 2, 2019May 8, 2025 By William Jojo
Java Book

(Updated May 8, 2025) Table of contents Overview Basic Tree Red-Black Trees AVL Tree B-Tree Special-Purpose Tree Exercises Overview The tree data structure provides a means of implementing sorted data in the form of a modified linked list such that traversals are far less expensive and approach O(log2n). We say they approach because the tree … Read More “Chapter 18 – Trees” »

Chapter 17 – Generic Methods and Classes

Posted on June 2, 2019April 24, 2025 By William Jojo
Java Book

(Updated January 16, 2025) Table of contents Overview The Cloneable Interface The Comparable Interface Generic Methods Generic Classes Generic Data Structures Exercises Overview Much of the code we have dealt with up to this point has been geared toward a specific data type. For example, a particular method or class is often centered around strings … Read More “Chapter 17 – Generic Methods and Classes” »

Chapter 16 – Stack, Queues and Deques

Posted on June 2, 2019January 14, 2025 By William Jojo
Java Book

(Updated January 14, 2025) Table of contents Overview Stacks Queues Deques (Double-Ended Queues) Exercises Overview This section expands linked lists. Remember that each data structure shown here is still a linked list. What changes are the rules governing how the object may be manipulated. Stacks Overview Stacks are a wondrous structure. This is mainly because … Read More “Chapter 16 – Stack, Queues and Deques” »

Posts pagination

Previous 1 … 10 11 12 … 18 Next

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Copyright © 2018 – 2025 Programming by Design.