(Updated December 5, 2022) Table of Contents So, About the Secret… Game Play – Introduction Checking for Validity Checking for Accuracy – Setup Checking for Accuracy – Right Color, Right Place Checking for Accuracy – Right Color, Wrong Place Report the Findings Future Code Additions Complete Code So, About the Secret… We will break with … Read More “CPbD CodeBreaker Interlude 3” »
Author: William Jojo
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” »
(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” »
(Updated December 5, 2022) Getting Started Ok. Now we have some basic abilities at our disposal. We can now begin roughing out the game – at least from the viewpoint of the initial setup. First, we will begin with a basic template for nearly all basic C programs: CodeBreakerI2.c (template) #include <stdio.h> int main(int argc, … Read More “CPbD CodeBreaker Interlude 2” »
(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” »
(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” »
(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” »
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” »
(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” »
(Updated June 12, 2022) [Note: Mastermind is a registered trademark ® of Invicta Toys and Games Ltd. and has been distributed by Pressman Toys, Hasbro, and Parker Brothers.] At one point, you may have played Mastermind®. Your opponent picks 4 pegs of various colors (red, orange, yellow, white, blue, green) and places them behind a … Read More “CPdB CodeBreaker Interlude 1” »