100% found this document useful (1 vote)
5K views

Instant ebooks textbook PHP and Algorithmic Thinking for the Complete Beginner 2nd Edition Learn to Think Like a Programmer Bouras download all chapters

Beginner

Uploaded by

kombeelali7i
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
5K views

Instant ebooks textbook PHP and Algorithmic Thinking for the Complete Beginner 2nd Edition Learn to Think Like a Programmer Bouras download all chapters

Beginner

Uploaded by

kombeelali7i
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 65

Download the Full Version of textbook for Fast Typing at textbookfull.

com

PHP and Algorithmic Thinking for the Complete


Beginner 2nd Edition Learn to Think Like a
Programmer Bouras

https://textbookfull.com/product/php-and-algorithmic-
thinking-for-the-complete-beginner-2nd-edition-learn-to-
think-like-a-programmer-bouras/

OR CLICK BUTTON

DOWNLOAD NOW

Download More textbook Instantly Today - Get Yours Now at textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Think Java How to Think Like a Computer Scientist 2nd


Edition Allen B. Downey

https://textbookfull.com/product/think-java-how-to-think-like-a-
computer-scientist-2nd-edition-allen-b-downey/

textboxfull.com

Python for Teenagers: Learn to Program like a Superhero!


2nd Edition Payne

https://textbookfull.com/product/python-for-teenagers-learn-to-
program-like-a-superhero-2nd-edition-payne/

textboxfull.com

Algorithmic Thinking 2nd Edition A Problem Based


Introduction Daniel Zingaro

https://textbookfull.com/product/algorithmic-thinking-2nd-edition-a-
problem-based-introduction-daniel-zingaro/

textboxfull.com

Think Perl 6 How to Think Like a Computer Scientist


Laurent Rosenfeld

https://textbookfull.com/product/think-perl-6-how-to-think-like-a-
computer-scientist-laurent-rosenfeld/

textboxfull.com
Think Julia How to Think Like a Computer Scientist 1st
Edition Allen Downey

https://textbookfull.com/product/think-julia-how-to-think-like-a-
computer-scientist-1st-edition-allen-downey/

textboxfull.com

Algorithmic Thinking. Learn Algorithms...Your Coding


Skills 2ed 2024 Zingaro D.

https://textbookfull.com/product/algorithmic-thinking-learn-
algorithms-your-coding-skills-2ed-2024-zingaro-d/

textboxfull.com

Think Java How to Think Like a Computer Scientist Second


Edition Allen B. Downey

https://textbookfull.com/product/think-java-how-to-think-like-a-
computer-scientist-second-edition-allen-b-downey/

textboxfull.com

Becoming A Programmer A Beginner s Guide 1st Edition Paul


Mabry

https://textbookfull.com/product/becoming-a-programmer-a-beginner-s-
guide-1st-edition-paul-mabry/

textboxfull.com

An Introduction to PHP: Learn PHP 8 to Create Dynamic


Websites 1st Edition Mark Simon

https://textbookfull.com/product/an-introduction-to-php-learn-
php-8-to-create-dynamic-websites-1st-edition-mark-simon/

textboxfull.com
PHP and Algorithmic Thinking for the Complete Beginner
Learn to Think Like a Programmer

Revised Second Edition

By
Aristides S. Bouras
PHP and Algorithmic Thinking for the Complete Beginner
Revised Second Edition

Copyright © by Aristides S. Bouras


https://www.bouraspage.com

Cover illustration and design: Philippos Papanikolaou

The following are either registered trademarks or trademarks of


Microsoft Corporation in the United States and/or other countries:
Microsoft, Windows, IntelliSense, SQL Server, .NET Framework,
Visual Studio, Visual Studio Code, VBA, Visual Basic, and Visual C#.
Oracle and Java are registered trademarks of Oracle and/or its
affiliates.
Python and PyCon are trademarks or registered trademarks of the
Python Software Foundation.
PHP is a copyright of the PHP Group.
Mazda and Mazda 6 are trademarks of the Mazda Motor Corporation
or its affiliated companies.
Ford and Ford Focus are trademarks of the Ford Motor Company.
All crossword puzzles were created with EclipseCrossword software
powered by Green Eclipse
Other names may be trademarks of their respective owners.

RCode: 200701

All rights reserved. No part of this book may be reproduced or


transmitted in any form or by any means, mechanical or electronic,
including photocopying, recording, or by any information storage
and retrieval system, without written permission from the authors.
Warning and Disclaimer
This book is designed to provide information about learning
“Algorithmic Thinking”, mainly through the use of PHP programming
language. Every effort has been taken to make this book compatible
with all releases of PHP, and it is almost certain to be compatible
with any future releases of it.
The information is provided on an “as is” basis. The authors shall
have neither liability nor responsibility to any person or entity with
respect to any loss or damages arising from the information
contained in this book or from the use of the files that may
accompany it.
Table of Contents
Table of Contents
Preface
About the Author
Acknowledgments
How This Book is Organized
Who Should Buy This Book?
Conventions Used in This Book
How to Report Errata
Where to Download Material About this Book
Section 1 Introductory Knowledge
Chapter 1 How a Computer Works
1.1 Introduction
1.2 What is Hardware?
1.3 What is Software?
1.4 How a Computer Executes (Runs) a Program
1.5 Compilers and Interpreters
1.6 What is Source Code?
1.7 Review Questions: True/False
1.8 Review Questions: Multiple Choice
Chapter 2 PHP
2.1 What is PHP?
2.2 What is the Difference Between a Script and a Program?
2.3 Why You Should Learn PHP
2.4 How PHP Works
Chapter 3 Software Packages to Install
3.1 XAMPP
3.2 How to Set Up XAMPP
3.3 Visual Studio
3.4 How to Set Up Visual Studio Code on Windows
Review in “Introductory Knowledge”
Review Crossword Puzzles
Review Questions
Section 2 Getting Started with PHP
Chapter 4 Introduction to Basic Algorithmic Concepts
4.1 What is an Algorithm?
4.2 The Algorithm for Making a Cup of Tea
4.3 Properties of an Algorithm
4.4 Okay About Algorithms. But What is a Computer Program
Anyway?
4.5 The Three Parties!
4.6 The Three Main Stages Involved in Creating an Algorithm
4.7 Flowcharts
Exercise 4.7-1 Finding the Average Value of Three Numbers
4.8 What are ”Reserved Words”?
4.9 What is the Difference Between a Statement and a
Command?
4.10 What is Structured Programming?
4.11 The Three Fundamental Control Structures
Exercise 4.11-1 Understanding Control Structures Using
Flowcharts
4.12 Your First PHP Script
4.13 What is the Difference Between a Syntax Error, a Logic
Error, and a Runtime Error?
4.14 Commenting Your Code
4.15 User-Friendly Programs and Scripts
4.16 Review Questions: True/False
4.17 Review Questions: Multiple Choice
Chapter 5 Variables and Constants
5.1 What is a Variable?
5.2 What is a Constant?
5.3 How Many Types of Variables and Constants Exist?
5.4 Rules for Naming Variables and Constants in PHP
5.5 What Does the Phrase “Declare a Variable” Mean?
5.6 How to Declare Variables in PHP
5.7 How to Declare Constants in PHP
5.8 Review Questions: True/False
5.9 Review Questions: Multiple Choice
5.10 Review Exercises
Chapter 6 Handling Input and Output
6.1 Which Statement Outputs Messages and Results on a User's
Screen?
6.2 How to Output Special Characters
6.3 Which Statement Lets the User Enter Data?
6.4 Review Questions: True/False
6.5 Review Questions: Multiple Choice
Chapter 7 Operators
7.1 The Value Assignment Operator
7.2 Arithmetic Operators
7.3 What is the Precedence of Arithmetic Operators?
7.4 Compound Assignment Operators
Exercise 7.4-1 Which PHP Statements are Syntactically
Correct?
Exercise 7.4-2 Finding Variable Types
7.5 Incrementing/Decrementing Operators
7.6 String Operators
Exercise 7.6-1 Concatenating Names
7.7 Review Questions: True/False
7.8 Review Questions: Multiple Choice
7.9 Review Exercises
Chapter 8 Trace Tables
8.1 What is a Trace Table?
Exercise 8.1-1 Creating a Trace Table
Exercise 8.1-2 Swapping Values of Variables
Exercise 8.1-3 Swapping Values of Variables – An Alternative
Approach
Exercise 8.1-4 Creating a Trace Table
Exercise 8.1-5 Creating a Trace Table
8.2 Review Questions: True/False
8.3 Review Exercises
Chapter 9 Using Visual Studio Code
9.1 Writing and Executing a PHP script in Visual Studio Code
9.2 What “Debugging” Means
9.3 Debugging PHP scripts with Visual Studio Code
9.4 Review Exercises
Review in “Getting Started with PHP
Review Crossword Puzzles
Review Questions
Section 3 Sequence Control Structures
Chapter 10 Introduction to Sequence Control Structures
10.1 What is the Sequence Control Structure?
Exercise 10.1-1 Calculating the Area of a Rectangle
Exercise 10.1-2 Calculating the Area of a Circle
Exercise 10.1-3 Calculating Fuel Economy
Exercise 10.1-4 Where is the Car? Calculating Distance
Traveled
Exercise 10.1-5 Kelvin to Fahrenheit
Exercise 10.1-6 Calculating Sales Tax
Exercise 10.1-7 Calculating a Sales Discount
Exercise 10.1-8 Calculating the Sales Tax Rate and Discount
10.2 Review Exercises
Chapter 11 Manipulating Numbers
11.1 Introduction
11.2 Useful Mathematical Functions (Subprograms), and More
Exercise 11.2-1 Calculating the Distance Between Two Points
Exercise 11.2-2 How Far Did the Car Travel?
11.3 Review Questions: True/False
11.4 Review Questions: Multiple Choice
11.5 Review Exercises
Chapter 12 Complex Mathematical Expressions
12.1 Writing Complex Mathematical Expressions
Exercise 12.1-1 Representing Mathematical Expressions in
PHP
Exercise 12.1-2 Writing a Mathematical Expression in PHP
Exercise 12.1-3 Writing a Complex Mathematical Expression
in PHP
12.2 Review Exercises
Chapter 13 Exercises With a Quotient and a Remainder
13.1 Introduction
Exercise 13.1-1 Calculating the Quotient and Remainder of
Integer Division
Exercise 13.1-2 Finding the Sum of Digits
Exercise 13.1-3 Displaying an Elapsed Time
Exercise 13.1-4 Reversing a Number
13.2 Review Exercises
Chapter 14 Manipulating Strings
14.1 Introduction
14.2 The Position of a Character in a String
14.3 Useful String Functions (Subprograms), and More
Exercise 14.3-1 Displaying a String Backwards
Exercise 14.3-2 Switching the Order of Names
Exercise 14.3-3 Creating a Login ID
Exercise 14.3-4 Creating a Random Word
Exercise 14.3-5 Finding the Sum of Digits
14.4 Review Questions: True/False
14.5 Review Questions: Multiple Choice
14.6 Review Exercises
Review in “Sequence Control Structures”
Review Crossword Puzzle
Review Questions
Section 4 Decision Control Structures
Chapter 15 Making Questions
15.1 Introduction
15.2 What is a Boolean Expression?
15.3 How to Write Simple Boolean Expressions
Exercise 15.3-1 Filling in the Table
15.4 Logical Operators and Complex Boolean Expressions
15.5 Assigning the Result of a Boolean Expression to a Variable
15.6 What is the Order of Precedence of Logical Operators?
15.7 What is the Order of Precedence of Arithmetic,
Comparison, and Logical Operators?
Exercise 15.7-1 Filling in the Truth Table
Exercise 15.7-2 Calculating the Results of Complex Boolean
Expressions
Exercise 15.7-3 Converting English Sentences to Boolean
Expressions
15.8 How to Negate Boolean Expressions
Exercise 15.8-1 Negating Boolean Expressions
15.9 Review Questions: True/False
15.10 Review Questions: Multiple Choice
15.11 Review Exercises
Chapter 16 The Single-Alternative Decision Structure
16.1 The Single-Alternative Decision Structure
Exercise 16.1-1 Trace Tables and Single-Alternative Decision
Structures
Exercise 16.1-2 The Absolute Value of a Number
16.2 Review Questions: True/False
16.3 Review Questions: Multiple Choice
16.4 Review Exercises
Chapter 17 The Dual-Alternative Decision Structure
17.1 The Dual-Alternative Decision Structure
Exercise 17.1-1 Finding the Output Message
Exercise 17.1-2 Trace Tables and Dual-Alternative Decision
Structures
Exercise 17.1-3 Who is the Greatest?
Exercise 17.1-4 Finding Odd and Even Numbers
Exercise 17.1-5 Weekly Wages
17.2 Review Questions: True/False
17.3 Review Questions: Multiple Choice
17.4 Review Exercises
Chapter 18 The Multiple-Alternative Decision Structure
18.1 The Multiple-Alternative Decision Structure
Exercise 18.1-1 Trace Tables and Multiple-Alternative
Decision Structures
Exercise 18.1-2 Counting the Digits
18.2 Review Questions: True/False
18.3 Review Exercises
Chapter 19 The Case Decision Structure
19.1 The Case Decision Structure
Exercise 19.1-1 The Days of the Week
19.2 Review Questions: True/False
19.3 Review Exercises
Chapter 20 Nested Decision Control Structures
20.1 What are Nested Decision Control Structures?
Exercise 20.1-1 Trace Tables and Nested Decision Control
Structures
Exercise 20.1-2 Positive, Negative or Zero?
20.2 A Mistake That You Will Probably Make!
20.3 Review Questions: True/False
20.4 Review Exercises
Chapter 21 More about Flowcharts with Decision Control
Structures
21.1 Introduction
21.2 Converting PHP scripts to Flowcharts
Exercise 21.2-1 Designing the Flowchart
Exercise 21.2-2 Designing the Flowchart
Exercise 21.2-3 Designing the Flowchart
21.3 Converting Flowcharts to PHP scripts
Exercise 21.3-1 Writing the PHP Script
Exercise 21.3-2 Writing the PHP Script
Exercise 21.3-3 Writing the PHP Script
21.4 Review Exercises
Chapter 22 Tips and Tricks with Decision Control Structures
22.1 Introduction
22.2 Choosing a Decision Control Structure
22.3 Streamlining the Decision Control Structure
Exercise 22.3-1 “Shrinking” the Algorithm
Exercise 22.3-2 “Shrinking” the PHP script
Exercise 22.3-3 “Shrinking” the Algorithm
22.4 Logical Operators – to Use, or not to Use: That is the
Question!
Exercise 22.4-1 Rewriting the Code
Exercise 22.4-2 Rewriting the Code
22.5 Merging Two or More Single-Alternative Decision
Structures
Exercise 22.5-1 Merging the Decision Control Structures
Exercise 22.5-2 Merging the Decision Control Structures
22.6 Replacing Two Single-Alternative Decision Structures with
a Dual-Alternative One
Exercise 22.6-1 “Merging” the Decision Control Structures
22.7 Put the Boolean Expressions Most Likely to be True First
Exercise 22.7-1 Rearranging the Boolean Expressions
22.8 Why is Code Indentation so Important?
22.9 Review Questions: True/False
22.10 Review Questions: Multiple Choice
22.11 Review Exercises
Chapter 23 More Exercises with Decision Control Structures
23.1 Simple Exercises with Decision Control Structures
Exercise 23.1-1 Both Odds or Both Evens?
Exercise 23.1-2 Is it an Integer?
Exercise 23.1-3 Validating Data Input and Finding Odd and
Even Numbers
Exercise 23.1-4 Converting Gallons to Liters, and Vice Versa
Exercise 23.1-5 Converting Gallons to Liters, and Vice Versa
(with Data Validation)
Exercise 23.1-6 Where is the Tollkeeper?
Exercise 23.1-7 The Most Scientific Calculator Ever!
23.2 Decision Control Structures in Solving Mathematical
Problems
Exercise 23.2-1 Finding the Value of y
Exercise 23.2-2 Finding the Values of y
Exercise 23.2-3 Solving the Linear Equation ax + b = 0
Exercise 23.2-4 Solving the Quadratic Equation ax2 + bx + c
=0
23.3 Finding Minimum and Maximum Values with Decision
Control Structures
Exercise 23.3-1 Finding the Name of the Heaviest Person
23.4 Exercises with Series of Consecutive Ranges of Values
Exercise 23.4-1 Calculating the Discount
Exercise 23.4-2 Validating Data Input and Calculating the
Discount
Exercise 23.4-3 Sending a Parcel
Exercise 23.4-4 Finding the Values of y
Exercise 23.4-5 Progressive Rates and Electricity
Consumption
Exercise 23.4-6 Progressive Rates and Text Messaging
Services
23.5 Exercises of a General Nature with Decision Control
Structures
Exercise 23.5-1 Finding a Leap Year
Exercise 23.5-2 Displaying the Days of the Month
Exercise 23.5-3 Is the Number a Palindrome?
Exercise 23.5-4 Checking for Proper Capitalization and
Punctuation
23.6 Review Exercises
Review in “Decision Control Structures”
Review Crossword Puzzle
Review Questions
Section 5 Loop Control Structures
Chapter 24 Introduction to Loop Control Structures
24.1 What is a Loop Control Structure?
24.2 From Sequence Control to Loop Control Structures
24.3 Review Questions: True/False
Chapter 25 Pre-Test, Mid-Test and Post-Test Loop Structures
25.1 The Pre-Test Loop Structure
Exercise 25.1-1 Designing the Flowchart and Counting the
Total Number of Iterations
Exercise 25.1-2 Counting the Total Number of Iterations
Exercise 25.1-3 Designing the Flowchart and Counting the
Total Number of Iterations
Exercise 25.1-4 Counting the Total Number of Iterations
Exercise 25.1-5 Finding the Sum of Four Numbers
Exercise 25.1-6 Finding the Sum of Odd Numbers
Exercise 25.1-7 Finding the Sum of N Numbers
Exercise 25.1-8 Finding the Sum of an Unknown Quantity of
Numbers
Exercise 25.1-9 Finding the Product of 20 Numbers
25.2 The Post-Test Loop Structure
Exercise 25.2-1 Designing the Flowchart and Counting the
Total Number of Iterations
Exercise 25.2-2 Counting the Total Number of Iterations
Exercise 25.2-3 Designing the Flowchart and Counting the
Total Number of Iterations
Exercise 25.2-4 Counting the Total Number of Iterations
Exercise 25.2-5 Finding the Product of N Numbers
25.3 The Mid-Test Loop Structure
Exercise 25.3-1 Designing the Flowchart and Counting the
Total Number of Iterations
25.4 Review Questions: True/False
25.5 Review Questions: Multiple Choice
25.6 Review Exercises
Chapter 26 The for statement
26.1 The for statement
Exercise 26.1-1 Creating the Trace Table
Exercise 26.1-2 Creating the Trace Table
Exercise 26.1-3 Counting the Total Number of Iterations
Exercise 26.1-4 Finding the Sum of Four Numbers
Exercise 26.1-5 Finding the Square Roots from 0 to N
Exercise 26.1-6 Finding the Sum of 1 + 2 + 3 + … + 100
Exercise 26.1-7 Finding the Product of 2 × 4 × 6 × 8 × 10
Exercise 26.1-8 Finding the Sum of 22 + 42 + 62 + … (2N)2
Exercise 26.1-9 Finding the Sum of 33 + 66 + 99 + …
(3N)3N
Exercise 26.1-10 Finding the Average Value of Positive
Numbers
Exercise 26.1-11 Counting the Vowels
26.2 Rules that Apply to For-Loops
Exercise 26.2-1 Counting the Total Number of Iterations
Exercise 26.2-2 Counting the Total Number of Iterations
Exercise 26.2-3 Counting the Total Number of Iterations
Exercise 26.2-4 Counting the Total Number of Iterations
Exercise 26.2-5 Finding the Sum of N Numbers
26.3 Review Questions: True/False
26.4 Review Questions: Multiple Choice
26.5 Review Exercises
Chapter 27 Nested Loop Control Structures
27.1 What is a Nested Loop?
Exercise 27.1-1 Say “Hello Zeus”. Counting the Total Number
of Iterations.
Exercise 27.1-2 Creating the Trace Table
27.2 Rules that Apply to Nested Loops
Exercise 27.2-1 Breaking the First Rule
Exercise 27.2-2 Counting the Total Number of Iterations
27.3 Review Questions: True/False
27.4 Review Questions: Multiple Choice
27.5 Review Exercises
Chapter 28 Tips and Tricks with Loop Control Structures
28.1 Introduction
28.2 Choosing a Loop Control Structure
28.3 The “Ultimate” Rule
28.4 Breaking Out of a Loop
28.5 Cleaning Out Your Loops
Exercise 28.5-1 Cleaning Out the Loop
Exercise 28.5-2 Cleaning Out the Loop
28.6 Endless Loops and How to Avoid Them
28.7 The “From Inner to Outer” Method
28.8 Review Questions: True/False
28.9 Review Questions: Multiple Choice
28.10 Review Exercises
Chapter 29 Flowcharts with Loop Control Structures
29.1 Introduction
29.2 Converting PHP scripts to Flowcharts
Exercise 29.2-1 Designing the Flowchart Fragment
Exercise 29.2-2 Designing the Flowchart Fragment
Exercise 29.2-3 Designing the Flowchart
Exercise 29.2-4 Designing the Flowchart Fragment
Exercise 29.2-5 Designing the Flowchart
Exercise 29.2-6 Designing the Flowchart
29.3 Converting Flowcharts to PHP scripts
Exercise 29.3-1 Writing the PHP Script
Exercise 29.3-2 Writing the PHP Script
Exercise 29.3-3 Writing the PHP Script
Exercise 29.3-4 Writing the PHP Script
29.4 Review Exercises
Chapter 30 More Exercises with Loop Control Structures
30.1 Simple Exercises with Loop Control Structures
Exercise 30.1-1 Counting the Numbers According to Which is
Greater
Exercise 30.1-2 Counting the Numbers According to Their
Digits
Exercise 30.1-3 How Many Numbers Fit in a Sum
Exercise 30.1-4 Finding the Total Number of Positive Integers
Exercise 30.1-5 Iterating as Many Times as the User Wishes
Exercise 30.1-6 Finding the Sum of the Digits
30.2 Exercises with Nested Loop Control Structures
Exercise 30.2-1 Displaying all Three-Digit Integers that
Contain a Given Digit
Exercise 30.2-2 Displaying all Instances of a Specified
Condition
30.3 Data Validation with Loop Control Structures
Exercise 30.3-1 Finding Odd and Even Numbers - Validation
Without Error Messages
Exercise 30.3-2 Finding Odd and Even Numbers - Validation
with One Error Message
Exercise 30.3-3 Finding Odd and Even Numbers - Validation
with Individual Error Messages
Exercise 30.3-4 Finding the Sum of Four Numbers
30.4 Using Loop Control Structures to Solve Mathematical
Problems
Exercise 30.4-1 Calculating the Area of as Many Triangles as
the User Wishes
Exercise 30.4-2 Finding x and y
Exercise 30.4-3 The Russian Multiplication Algorithm
Exercise 30.4-4 Finding the Number of Divisors
Exercise 30.4-5 Is the Number a Prime?
Exercise 30.4-6 Finding all Prime Numbers from 1 to N
Exercise 30.4-7 Heron's Square Root
Exercise 30.4-8 Calculating π
Exercise 30.4-9 Approximating a Real with a Fraction
30.5 Finding Minimum and Maximum Values with Loop Control
Structures
Exercise 30.5-1 Validating and Finding the Minimum and the
Maximum Value
Exercise 30.5-2 Validating and Finding the Hottest Planet
Exercise 30.5-3 ”Making the Grade”
30.6 Exercises of a General Nature with Loop Control Structures
Exercise 30.6-1 Fahrenheit to Kelvin, from 0 to 100
Exercise 30.6-2 Rice on a Chessboard
Exercise 30.6-3 Just a Poll
Exercise 30.6-4 Is the Message a Palindrome?
30.7 Review Questions: True/False
30.8 Review Exercises
Review in “Loop Control Structures”
Review Crossword Puzzle
Review Questions
Section 6 Arrays in PHP
Chapter 31 One-Dimensional Arrays
31.1 Introduction
31.2 What is an Array?
Exercise 31.2-1 Designing an Array
Exercise 31.2-2 Designing Arrays
Exercise 31.2-3 Designing Arrays
31.3 Creating One-Dimensional Arrays in PHP
31.4 How to Get Values from a One-Dimensional Array
Exercise 31.4-1 Creating the Trace Table
Exercise 31.4-2 Using a Non-Existing Index
31.5 How to Alter the Value of an Array Element
31.6 How to Iterate Through a One-Dimensional Array
Exercise 31.6-1 Finding the Sum
31.7 How to Add User-Entered Values to a One-Dimensional
Array
Exercise 31.7-1 Displaying Words in Reverse Order
Exercise 31.7-2 Displaying Positive Numbers in Reverse
Order
Exercise 31.7-3 Finding the Average Value
Exercise 31.7-4 Displaying Reals Only
Exercise 31.7-5 Displaying Elements with Odd-Numbered
Indexes
Exercise 31.7-6 Displaying Even Numbers in Odd–Numbered
Index Positions
31.8 What is an Map?
31.9 Creating Associative Arrays in PHP
31.10 How to Get a Value from an Associative Array
Exercise 31.10-1 Using a Non-Existing Key in Dictionaries
31.11 How to Alter the Value of an Element of an Associative
Array
31.12 How to Iterate Through an Associative Array
31.13 Review Questions: True/False
31.14 Review Questions: Multiple Choice
31.15 Review Exercises
Chapter 32 Two-Dimensional Arrays
32.1 Creating Two-Dimensional Arrays in PHP
32.2 How to Get Values from Two-Dimensional Arrays
Exercise 32.2-1 Creating the Trace Table
32.3 How to Iterate Through a Two-Dimensional Array
32.4 How to Add User-Entered Values to a Two-Dimensional
Array
Exercise 32.4-1 Displaying Reals Only
Exercise 32.4-2 Displaying Odd Columns Only
32.5 What's the Story on Variables i and j?
32.6 Square Matrices
Exercise 32.6-1 Finding the Sum of the Elements of the Main
Diagonal
Exercise 32.6-2 Finding the Sum of the Elements of the
Antidiagonal
Exercise 32.6-3 Filling in the Array
32.7 Review Questions: True/False
32.8 Review Questions: Multiple Choice
32.9 Review Exercises
Chapter 33 Tips and Tricks with Arrays
33.1 Introduction
33.2 Processing Each Row Individually
Exercise 33.2-1 Finding the Average Value
33.3 Processing Each Column Individually
Exercise 33.3-1 Finding the Average Value
33.4 How to Use More Than One Arrays in a Program
Exercise 33.4-1 Finding the Average Value of Two Grades
Exercise 33.4-2 Finding the Average Value of More than Two
Grades
Exercise 33.4-3 Using an Indexed Array Along with an
Associative Array
33.5 Creating a One-Dimensional Array from a Two-Dimensional
Array
33.6 Creating a Two-Dimensional Array from a One-Dimensional
Array
33.7 Review Questions: True/False
33.8 Review Questions: Multiple Choice
33.9 Review Exercises
Chapter 34 More Exercises with Arrays
34.1 Simple Exercises with Arrays
Exercise 34.1-1 Creating an Array that Contains the Average
Values of its Neighboring Elements
Exercise 34.1-2 Creating an Array with the Greatest Values
Exercise 34.1-3 Merging One-Dimensional Arrays
Exercise 34.1-4 Merging Two-Dimensional Arrays
Exercise 34.1-5 Creating Two Arrays – Separating Positive
from Negative Values
Exercise 34.1-6 Creating an Array with Those who Contain
Digit 5
34.2 Data Validation with Arrays
Exercise 34.2-1 Displaying Odds in Reverse Order –
Validation Without Error Messages
Exercise 34.2-2 Displaying Odds in Reverse Order –
Validation with One Error Message
Exercise 34.2-3 Displaying Odds in Reverse Order –
Validation with Individual Error Messages
34.3 Finding Minimum and Maximum Values in Arrays
Exercise 34.3-1 Which Depth is the Greatest?
Exercise 34.3-2 Which Lake is the Deepest?
Exercise 34.3-3 Which Lake, in Which Country, Having Which
Average Area, is the Deepest?
Exercise 34.3-4 Which Students Have got the Greatest
Grade?
Exercise 34.3-5 Finding the Minimum Value of a Two-
Dimensional Array
Exercise 34.3-6 Finding the City with the Coldest Day
Exercise 34.3-7 Finding the Minimum and the Maximum
Value of Each Row
34.4 Sorting Arrays
Exercise 34.4-1 The Bubble Sort Algorithm – Sorting One-
Dimensional Arrays with Numeric Values
Exercise 34.4-2 Sorting One-Dimensional Arrays with
Alphanumeric Values
Exercise 34.4-3 Sorting One-Dimensional Arrays While
Preserving the Relationship with a Second Array
Exercise 34.4-4 Sorting Last and First Names
Exercise 34.4-5 Sorting a Two-Dimensional Array
Exercise 34.4-6 The Modified Bubble Sort Algorithm – Sorting
One-Dimensional Arrays
Exercise 34.4-7 The Five Best Scorers
Exercise 34.4-8 The Selection Sort Algorithm – Sorting One-
Dimensional Arrays
Exercise 34.4-9 Sorting One-Dimensional Arrays While
Preserving the Relationship with a Second Array
Exercise 34.4-10 The Insertion Sort Algorithm – Sorting One-
Dimensional Arrays
Exercise 34.4-11 The Three Worst Elapsed Times
34.5 Searching Elements in Arrays
Exercise 34.5-1 The Linear Search Algorithm – Searching in a
One-Dimensional Array that may Contain the Same Value
Multiple Times
Exercise 34.5-2 Display the Last Names of All Those People
Who Have the Same First Name
Exercise 34.5-3 The Linear Search Algorithm – Searching in a
One-Dimensional Array that Contains Unique Values
Exercise 34.5-4 Searching for a Given Social Security Number
Exercise 34.5-5 The Linear Search Algorithm – Searching in a
Two-Dimensional Array that May Contain the Same Value
Multiple Times
Exercise 34.5-6 Searching for Wins, Losses and Ties
Exercise 34.5-7 The Linear Search Algorithm – Searching in a
Two-Dimensional Array that Contains Unique Values
Exercise 34.5-8 Checking if a Value Exists in all Columns
Exercise 34.5-9 The Binary Search Algorithm – Searching in a
Sorted One-Dimensional Array
Exercise 34.5-10 Display all the Historical Events for a
Country
Exercise 34.5-11 Searching in Each Column of a Two-
Dimensional Array
34.6 Exercises of a General Nature with Arrays
Exercise 34.6-1 On Which Days was There a Possibility of
Snow?
Exercise 34.6-2 Was There Any Possibility of Snow?
Exercise 34.6-3 In Which Cities was There a Possibility of
Snow?
Exercise 34.6-4 Display from Highest to Lowest Grades by
Student, and in Alphabetical Order
Exercise 34.6-5 Archery at the Summer Olympics
34.7 Review Questions: True/False
34.8 Review Exercises
Review in “Arrays in PHP”
Review Crossword Puzzle
Review Questions
Section 7 Subprograms
Chapter 35 Introduction to Subprograms
35.1 What Exactly is a Subprogram?
35.2 What is Procedural Programming?
35.3 What is Modular Programming?
35.4 Review Questions: True/False
Chapter 36 User-Defined Subprograms
36.1 Subprograms that Return Values
36.2 How to Make a Call to a Function
36.3 Subprograms that Return no Values
36.4 How to Make a Call to a void Function
36.5 Formal and Actual Arguments
36.6 How Does a Function Execute?
Exercise 36.6-1 Back to Basics – Calculating the Sum of Two
Numbers
Exercise 36.6-2 Calculating the Sum of Two Numbers Using
Fewer Lines of Code!
36.7 How Does a void Function Execute?
Exercise 36.7-1 Back to Basics – Displaying the Absolute
Value of a Number
36.8 Review Questions: True/False
36.9 Review Exercises
Chapter 37 Tips and Tricks with Subprograms
37.1 Can Two Subprograms use Variables of the Same Name?
37.2 Can a Subprogram Call Another Subprogram?
37.3 Passing Arguments by Value and by Reference
Exercise 37.3-1 Finding the Logic Error
37.4 Passing and/or Returning an Array
37.5 Default Argument Values (Optional Arguments)
37.6 The Scope of a Variable
37.7 Converting Parts of Code into Subprograms
37.8 Recursion
Exercise 37.8-1 Calculating the Fibonacci Sequence
Recursively
37.9 Review Questions: True/False
37.10 Review Exercises
Chapter 38 More Exercises with Subprograms
38.1 Simple Exercises with Subprograms
Exercise 38.1-1 Designing the Flowchart
Exercise 38.1-2 Designing the Flowchart
Exercise 38.1-3 A Simple Currency Converter
Exercise 38.1-4 A More Complete Currency Converter
Exercise 38.1-5 Finding the Average Values of Positive
Integers
Exercise 38.1-6 Finding the Sum of Odd Positive Integers
Exercise 38.1-7 Finding the Values of y
38.2 Exercises of a General Nature with Subprograms
Exercise 38.2-1 Validating Data Input Using a Subprogram
Exercise 38.2-2 Sorting an Array Using a Subprogram
Exercise 38.2-3 Progressive Rates and Electricity
Consumption
Exercise 38.2-4 Roll, Roll, Roll the… Dice!
Exercise 38.2-5 How Many Times Does Each Number of the
Dice Appear?
38.3 Review Exercises
Review in “Subprograms”
Review Crossword Puzzle
Review Questions
Section 8 Object-Oriented Programming
Chapter 39 Introduction to Object-Oriented Programming
39.1 What is Object-Oriented Programming?
39.2 Classes and Objects in PHP
39.3 The Constructor and the Keyword $this
39.4 Passing Initial Values to the Constructor
Exercise 39.4-1 Historical Events
39.5 Getter and Setter Methods
Exercise 39.5-1 The Roman Numerals
39.6 Can a Method Call Another Method of the Same Class?
Exercise 39.6-1 Doing Math
39.7 Class Inheritance
39.8 Review Questions: True/False
39.9 Review Exercises
Review in “Object-Oriented Programming”
Review Crossword Puzzle
Review Questions
Some Final Words from the Author
Preface
About the Author
Aristides [1] S. Bouras was born in 1973. During his early childhood,
he discovered a love of computer programming. He got his first
computer at the age of 12, a Commodore 64, which incorporated a
ROM-based version of the BASIC programming language and 64
kilobytes of RAM!!!
He holds a degree in Computer Engineering from the Technological
Educational Institute of Piraeus, and a Dipl. Eng. degree in Electrical
and Computer Engineering from the Democritus University of
Thrace.
He worked as a software developer at a company that specialized in
industrial data flow and labelling of products. His main job was to
develop software applications for data terminals, as well as PC
software applications for collecting and storing data on a Microsoft
SQL Server® .
He has developed many applications such as warehouse managing
systems and websites for companies and other organizations.
Nowadays, he works as a high school teacher. He mainly teaches
courses in computer networks, programming tools for the
Internet/intranets, and databases.
He has written a number of books, mainly about algorithmic and
computational thinking through the use of PHP, Java, Python, C++,
Arduino C/C++, C#, and Visual Basic programming languages.
He is married and he has two children.
Acknowledgments
I would like to thank, with particular gratefulness, my friend and
senior editor Victoria (Vicki) Austin for her assistance in copy
editing. Without her, this book might not have reached its full
potential. With her patient guidance and valuable and constructive
suggestions, she helped me bring this book up to a higher level!

How This Book is Organized


The book you hold in your hands follows the spiral curriculum
teaching approach, a method proposed in 1960 by Jerome Bruner,
an American psychologist. According to this method, as a subject is
being taught, basic ideas are revisited at intervals—at a more
sophisticated level each time—until the reader achieves a complete
understanding of the subject. First, the reader learns the basic
elements without worrying about the details. Later, more details are
taught and basic elements are mentioned again and again,
eventually being stored in the brain's long term memory.
According to Jerome Bruner, learning requires the student's active
participation, experimentation, exploration, and discovery. This book
contains many examples, most of which can be practically
performed. This gives the reader the opportunity to get his or her
hands on PHP and become capable of creating his or her own
programs.

Who Should Buy This Book?


Thoroughly revised for the latest version of PHP, this book explains
basic concepts in a clear and explicit way that takes very seriously
one thing for granted—that the reader knows nothing about
computer programming.
Addressed to anyone who has no prior programming knowledge or
experience, but a desire to learn programming with PHP, it teaches
the first thing that every novice programmer needs to learn, which
is Algorithmic Thinking . Algorithmic Thinking involves more than
just learning code. It is a problem-solving process that involves
learning how to code.
This edition contains all the popular features of the previous edition
and adds a significant number of exercises, as well as extensive
revisions and updates. Furthermore, a brand new section provides
an effective introduction to the next field that a programmer needs
to work with, which is Object Oriented Programming (OOP).
This book has a class course structure with questions and exercises
at the end of each chapter so you can test what you have learned
right away and improve your comprehension. With 250 solved and
450 unsolved exercises, 475 True/False, about 150 multiple choice,
and 200 review questions and crosswords (the solutions and the
answers to which can be found on the Internet), this book is ideal
for
► novices or average programmers, for self-study
► high school students
► first-year college or university students
► teachers
► professors
► anyone who wants to start learning or teaching computer
programming using the proper conventions and techniques
Conventions Used in This Book
Following are some explanations on the conventions used in this
book. “Conventions” refer to the standard ways in which certain
parts of the text are displayed.
PHP Statements
This book uses plenty of examples written in PHP language. PHP
statements are shown in a typeface that looks like this.
This is a PHP statement

Keywords, Variables, Functions, and Arguments Within the


Text of a Paragraph
Keywords, variables, functions (subprograms), and arguments are
sometimes shown within the text of a paragraph. When they are,
the special text is shown in a typeface different from that of the rest
of the paragraph. For instance, $first_name = 5 is an example of a
PHP statement within the paragraph text.
Words in Italics
You may notice that some of the special text is also displayed in
italics. In this book, italicized words are general types that must be
replaced with the specific name appropriate for your data. For
example, the general form of a PHP statement may be presented as
function name ($arg1 , $arg2 )

In order to complete the statement, the keywords name , $ arg1 ,


and $ arg2 must be replaced with something meaningful. When you
use this statement in your code, you might use it in the following
form.
function display_rectangle($width, $height)

Three dots (…): an Ellipsis


In the general form of a statement you may also notice three dots (
… ), also known as an “ellipsis”, following a list in an example. They
are not part of the statement. An ellipsis indicates that you can have
as many items in the list as you want. For example, the ellipsis in
the general form of the statement
Discovering Diverse Content Through
Random Scribd Documents
there reigned a darkness of impenetrable gloom and density. None
of the children ventured to ascend alone.
Maria scrambled up. She counted the steps. Like the rushing of a
thousand wings came the sound of the children’s feet behind her, in
the narrow spiral. She did not know how long she had been climbing
up. Innumerable hands were clutching her damp dress. She dragged
her burdens upward, praying, moaning the while—praying only for
strength for another hour.
“Don’t cry, little brothers!” she stammered. “My little sisters, please
don’t cry.”
Children were screaming, down in the depths—and the hundred
windings of the stairway gave echo’s trumpet to each cry:
“Mother—! Mother—!”
And once more:
“The water’s coming—!”
Stop and lie down, halfway up the stairs—? No!
“Little sisters! Little brothers—do come along!”
Higher—winding ever and always higher upward; then, at last, a
wide landing. Greyish light from above. A walled-in room; not yet
the upper world, but its fore-court. A short, straight flight of stairs
upon which lay a shaft of light. The opening, a trap-door, which
seemed to be pressed inwards. Between the door and the square of
the wall, a cleft, as narrow as a cat’s body.
Maria saw that. She did not know what it meant. She had the
uncertain feeling of something not being as it ought to be. But she
did not want to think about it. With an almost violent movement she
tore her hands, her gown, free from the children’s tugging fingers,
and dashed, hurled forward far more by her desperate will than by
her benumbed feet, through the empty room and up the steep
stairway.
She stretched out her hands and tried to raise the pressed-in door. It
did not budge. Once more. No result. Head, arms, shoulders
pushing, hips and knees pressing, as if to burst their sinews. No
result. The door did not yield by a hair’s breadth. If a child had tried
to push the cathedral from its place it could not have acted more
foolishly nor ineffectually.
For, upon the door, which alone led the way out of the depths, there
towered, as high as houses, the corpses of the dead engines, which,
when madness first broke out over Metropolis, had been the terrible
playthings of the mob. Train upon train, with carriages thundering
along, all lights burning and on full power, had rushed along the
rails, lashed by the bawling of the mob, had fallen upon each other,
had become mixed and piled up together, had burnt down and were
now lying, half-melted, still smouldering, a mass of ruins. And one,
single lamp, remaining undamaged, threw the shaft of its sharp,
corrosive light over the chaos, from the steel breast of the hindmost
engine.
But Maria knew nothing of all this. She did not need to know.
Sufficient for her that the door, which was the only means of
deliverance for her and the children she wanted to save, remained
inexorable, immovable, and finally, with bleeding hands and
shoulders, with battered head, and feet crippled with numbness, she
was obliged to resign herself to the incomprehensible, to the
murderous.
She raised her face to the ray of light which fell upon her. The words
of a little, childish prayer, now no longer intelligible, ran through her
head. She dropped her head and sat down on the stairs.
The children stood in silence, crowded closely together, under the
curse of something which, though they could not understand it, was
very close above them.
“Little brothers, little sisters,” said Maria’s voice, very affectionately,
“can you all understand what I am saying?”
“Yes,” floated up from the children.
“The door is closed.... We must wait a little.... Someone is sure to
come and open it for us. Will you be patient and not be frightened?”
“Yes,” came an answer, as a sigh.
“Sit down as well as you can....”
The children obeyed.
“I am going to tell you a story,” said Maria.
CHAPTER XVIII
“Little sister....”
“Yes?”
“I am so hungry, sister...!”
“Hungry...!” echoed out of the depths.
“Don’t you want to hear the end of my story?”
“Yes.... But sister, when you’ve finished, can’t we go out and have
dinner?”
“Of course ... as soon as my story’s finished.... Just think: Foxy Fox
went for a walk—went for a walk through the beautiful flowery
meadows; he had his Sunday coat on, and he held his bushy red tail
bolt upright, and he was smoking his little pipe and singing all the
while.... Do you know what Foxy Fox sang?—

I am the cheerful Fox—Hurray!


I am the cheerful Fox—Hurray!

And then he hopped for joy! And little Mr. Hedgehog was sitting on
his hillock and he was so glad that his radishes were coming on so
nicely, and his wife was standing by the hedge, gossiping with Mrs.
Mole, who had just got a new fur for the Autumn....”
“Sister....”
“Yes?”
“Can the water from down there be coming up after us?”
“Why, little brother?”
“I can hear it gurgling....”
“Don’t listen to the water, little brother ... just listen to what Mrs.
Hedgehog has to chatter about!”
“Yes, sister, but the water is chattering so loud ... I think it chatters
much louder than Mrs. Mole....”
“Come away from the stupid water, little brother.... Come here to
me! You can’t hear the water here!”
“I can’t come to you sister! I can’t move, sister.... Can’t you come
and fetch me?”
“Me too, sister—yes, me too!—me too!”
“I can’t do that, little brothers, little sisters! Your youngest brothers
and sisters are on my lap. They have gone to sleep and I mustn’t
wake them!”
“Oh sister, are we sure to get out?”
“Why do you ask as if you were frightened, little brother?”
“The floor is shaking so and stones are tumbling down from the
ceiling!”
“Have those silly stones hurt you?”
“No, but my little sister’s lying down and she’s not moving any
more.”
“Don’t disturb her, little brother. Your sister’s asleep!”
“Yes, but she was crying just now...!”
“Don’t be sorry little brother that she had gone where she need not
cry any more....”
“Where has she gone to, then, sister?”
“To heaven, I think.”
“Is heaven so near, then?”
“Oh yes, quite near. I can even see the door from here! And if I’m
not wrong, Saint Peter is standing there, in front of it, with a large
golden key, waiting until he can let us in....”
“Oh, sister ... sister!! Now the water’s coming up—! Now it’s got hold
of my feet! Now it’s lifting me up—!”
“Sister!! Help me, sister.—The water has come—!!”
“God can help you—Almighty God!”
“Sister, I’m frightened!”
“Are you frightened of going into the lovely heaven?”
“Is it lovely in heaven?”
“Oh—glorious—glorious!”
“Is Foxy Fox in heaven, too—and little Mr. Hedgehog?”
“I don’t know! Shall I ask Saint Peter about it?”
“Yes, sister.... Are you crying?”
“No, why should I be crying?—Saint Peter—! Saint Peter—!”
“Did he hear?”
“Dear God, how cold the water is....”
“Saint Peter—! Saint Peter—!!”
“Sister.... I think he answered, just now....”
“Really, little brother?”
“Yes ... somebody was calling....”
“Yes, I heard it, too!”
“... So did I....”
“... So did I....”
“Hush, children, hush....”
“Oh, sister, sister—!”
“Hush, please—please—!”
“... Maria—!”
“Freder—!!!”
“Maria—are you there—?”
“Freder—Freder—here I am! Here I am, Freder—!!”
“On the stairs?”
“Yes!”
“Why don’t you come up?”
“I can’t raise the door!”
“Ten trains have run together.... I can’t come to you! I must go and
get help!”
“Oh, Freder, the water’s already close behind us!”
“The water—?”
“Yes!—And the walls are falling in!”
“Are you hurt—?”
“No, no.... Oh, Freder, if you could only force open the door wide
enough for me to push the little children’s bodies through....”
The man above her did not give her an answer.
When steeling his muscles and sinews in the “Club of the Sons,”
playfully wrestling with his friends, he surely never guessed that he
would need them one day to force a path through ruined cables,
upright pistons and out-spread wheels of fallen machines to the
woman he loved. He thrust the pistons aside like human arms,
clutched into steel as into soft, yielding flesh. He worked his way
nearer the door and threw himself on the ground.
“Maria—?”
“Freder?”
“Where are you? Why does your voice sound so far away?”
“I want to be the last whom you save, Freder! I am carrying the
tiniest ones on my shoulders and arms....”
“Is the water still rising?”
“Yes.”
“Is it rising fast or slowly?”
“Fast.”
“My God, my God.... I can’t get the door loose! The machines are
piled up on top of it like mountains! I must explode the ruins,
Maria!”
“Very well.” Maria’s voice sounded as though she were smiling.
“Meanwhile I can finish telling my story....”
Freder dashed away. He did not know where his feet should carry
him. He thought vaguely of God.... “Thy will be done.... Deliver us
from evil.... For Thine is the ... power....”
From the sooty black sky a frightful gleam, of the colour of spilt
blood, fell upon the city, which appeared as a silhouette of tattered
velvet in the painful scarcity of light. There was not a soul to be seen
and yet the air throbbed under the unbearable knife-edge of shrieks
of women from the vicinity of Yoshiwara, and, while the organ of the
cathedral was shrilling and whistling, as though its mighty body were
wounded unto death, the windows of the cathedral, lighted from
within, began, phantom-like to glow.
Freder staggered along to the tower-house in which the heart of the
great machine-city of Metropolis had lived, and which it had torn
open from top to bottom, when racing itself to death, in the fever of
the “12,” so that the house now looked like a ripped open, gaping
gate.
A lump of humanity was crawling about the ruins, seeming, from the
sounds it emitted, to be nothing but a single curse, on two legs. The
horror which lay over Metropolis was Paradise compared with the
last, cruel destruction which the lump of humanity was invoking from
the lowest and hottest of hells upon the city and its inhabitants.
He found something among the ruins, raised it to his face,
recognised it and broke out into howls, similar to the howls of a
kicked dog. He rubbed his sobbing mouth upon the little piece of
steel.
“May the stinking plague gnaw you, you lice—! May you sit in muck
up to your eyes—! May you swill gas instead of water and burst
every day—for ten thousand years—over and over again—!”
“Grot!”
“Filth—!”
“Grot!!—Thank God.... Grot, come here!”
“Who’s that—”
“I am Joh Fredersen’s son—”
“Aaah—Hell and the devil—I wanted you—! Come here, you toad—!
I must have you between my fists. I’d much rather have had your
father, but you’re a bit of him and better than nothing! Come along
here, if you’ve got the guts. Ah—my lad, wouldn’t I like to get hold
of you! I’d like to smear you from top to toe in mustard and eat you!
D’you know what your father’s done—?”
“Grot—!”
“Let me finish—I tell you! Do you know what he did—? He made me
give up ... he made me give up my machine....”
And once more the miserable howling of a kicked dog.
“My machine ... my—my machine—! That devil up there! That God-
damned devil!...”
“Grot, listen to me—”
“I won’t listen to anything!—”
“Grot, in the underground city, the water has broken in....”
Seconds of silence. Then—roars of laughter, and, on the heap of
ruins, the dance of a four-legged lump, which kicked its stumps amid
wild yells, clapping its hands the while.
“That’s right—! Hallelujah Amen—!”
“Grot—!” Freder laid fast hold of the dancing lump and shook it so
that its teeth rattled. “The water has flooded the city! The lights lie
in ruins! The water has risen up the steps! And upon the door—upon
the only door, there lie tons upon tons of trains which collided with
each other there!”
“Let the rats drown—!”
“The children, Grot—!!”
Grot stood as if paralysed.
“A girl,” continued Freder, clutching his hand into the man’s shoulder,
“a girl,” he said sobbingly, bending his head as if to bury it in the
man’s breast, “a girl has tried to save the children and is now shut in
with them and can’t get out—”
Grot began to run.
“We must explode the ruins, Grot!”
Grot stumbled, turned about and went on running, Freder behind
him, closer than his shadow....

“... But Foxy Fox knew very well that Mr. Hedgehog would come to
help him out of the trap, and he wasn’t a bit frightened and waited
quite cheerfully, although it was a good long time before Mr.
Hedgehog—gallant Mr. Hedgehog! came back....”
“Maria—!”
“Oh Christ.... Freder?”
“Don’t be startled, do you hear?”
“Freder, you’re not in danger?”
No answer. Silence. A crackling sound. Then a childish voice:
“And did Mr. Hedgehog come, sister?”
“Yes—”
But the “yes” was drowned by the tearing of thousands of steel
cables, the roar of tens of thousands of rocks which were hurled up
to the dome of heaven, to burst the dome and to sink, to hurtle
downwards, causing the earth to sway under their fall.
Supplementary crackling. Grey, leisurely clouds. Distant rumbling.
And steps. Childish crying. And, up above, the door which was
hauled upwards:
“Maria—!”
A blackened face bent downwards; filthy hands stretched out,
gropingly.
“Maria—!”
“Here I am, Freder!”
“I can hardly hear you....”
“Get the children out first, Freder.... The wall’s sinking....”
Grot came lumbering along and threw himself on the ground by
Freder’s side, clutching down into the pit from which the children
were scrambling out, screaming. He grabbed the children by the
hair, by the neck, by the head, and hauled them up, as one pulls up
radishes. His eyes were popping out of his head with fear. He hurled
the children over his body, so that they tumbled over, shrieking
miserably. He cursed like a hundred devils.
“Isn’t that nearly all of them—?”
He bawled down two names....
“Father, father—!” sobbed two little voices in the depths.
“The devil take you, you couple of Jackanapes!” roared the man. He
rummaged the children aside with his fists, as if he were shovelling
rubbish on the dustheap. Then he gulped, snorted, clutched out, and
had two children hanging around his neck, wet and shivering
piteously, but alive—and their limbs stood more in danger of his
fumbling fists than previously of the water and the tumbling stones.
With the children in both arms, Grot rolled over on his side. He sat
up and planted the couple before him.
“You God-damned pair of ragamuffins!” he said, amidst sobs. He
wiped the tears from his eyes. And sprang up, hurling the children
aside, like two little hay-stooks. With the furious roar of a lion, he
ran to the door, from the depths of which Maria was emerging, with
closed eyes, supported by Freder’s arm.
“You bloody—!” he howled out. He dragged Freder aside, shoved the
girl back into the depths, slammed the trap-door to, and slung his
entire weight upon it, drumming the rhythm of his laughter upon it
with clenched fists.
A grim effort had kept Freder on his feet. Beside himself, he fell
upon the maniac to tug him from the trap-door, fell over him and
rolled with him, in furious embrace, among the ruins of the
machines.
“Let me go, you dog, you mangy dog!” howled Grot, trying to bite at
the angry fist which held him. “That woman murdered my machine—
That dam’ woman led the rabble—! That woman alone turned the
lever to ‘12’—! I saw it when they were trampling on me—! The
woman can drown down there—! I’m going to kill that woman—!”
With marvellous tension of all his muscles Grot drew himself up and
heaved himself, with a jerk, away from the raving man—with such
infuriated strength that he, Grot, shot, describing a curve, amidst the
children.
Cursing ardently, he gathered himself up again; but, though he was
uninjured, he could not move a limb. He stuck, an impotent spoon,
in a porridge of children, which adhered to his arms, legs and fists.
No steel fetters could have condemned him so effectually to
helplessness, as did the little cold, wet hands, which were defending
her who had rescued them all. Yes, his own children were standing
before him, pommelling angrily upon his clenched fists, unscared by
the blood-shot eyes with which the giant glared at the dwarves,
cudgelling him.
“That woman murdered my machine—!” he howled out at last, more
complainingly than angrily, looking at the girl, who was resting upon
Freder’s arm, as though expecting her to bear him out.
“What does he mean?” asked Maria. “And what has happened?”
And she looked with eyes, the horror in which was only modified by
the deepest of exhaustion, at the destruction round about, and at
the snorting Grot.
Freder did not answer.
“Come,” he said. And he raised her up in his arms and carried her
out. The children followed them like a flock of little lambs, and Grot
had no alternative than to run along in the tracks of the tiny feet,
whither the little, tugging hands drew him.
CHAPTER XIX
They had taken the children into the house and Freder’s eyes sought
Maria, who was kneeling in the street, among the last remaining
children, consoling them, and bestowing her loving smile upon
weeping and bewildered eyes.
Freder ran across to them and carried Maria into the house.
“Don’t forget,” he said, letting her down upon a couch before the
blazing fire in the entrance hall, and holding captive in his longing
arms her half-lying, half-sitting, gently resisting form, “that Death
and madness and something very like destruction of the world have
passed very close by us—and that, after all that has happened, I do
not even know the colour of your eyes—and that you have not yet
kissed me once by your own free will....”
“Dearest,” said Maria, leaning towards him, so that her pure eyes,
bathed in painless tears, were quite near to him, while, at the same
time, a great, concentrated gravity kept her lips away from his, “are
you sure that Death and madness have already passed by?”
“By us, beloved—yes!”
“And all the others—?”
“Are you sending me away, Maria?” he asked, lovingly. She did not
answer, at least not in words. But, with a gesture which was at once
frank and touching, she put her arms about his neck and kissed him
on the mouth.
“Go along,” she said, stroking his bewildered face with her virginal,
motherly hands. “Go to your father. That is the most hallowed way....
I shall go to the children as soon as my clothes are a little dryer. For
I’m afraid,” she added with a smile which made Freder blush to his
eyes, “numerous as the women are who live in the ‘House of the
Sons,’ and willing and eager as they may be, not one of them has a
dress she could lend me...!”
Freder stood bending over her with lowered eyes. The flames of the
huge fire glowed upon his handsome, open face, which wore an
expression of shame and sadness. But when he raised his glance to
meet Maria’s eyes, which were silently fixed upon him, without
saying a word he took her hands and pressed them against his eye-
lids, remaining thus for a long time.
And all this while they both forgot that, on the other side of the wall
which was protecting them, a city was throbbing in grisly conflict,
and that among the ruins thousands of beings, themselves but ruins,
hurled hither and thither, were losing their reason, and perishing,
tortured by deadly fear.
The voice of the Archangel Michael, coming from the cathedral,
recalled them to consciousness of the hour, and they parted
hurriedly, as if caught neglecting their duty.
Maria listened to the man’s retreating step....
Then she turned and looked about her.
What a strange sound the Michael bell had.... The bell was calling so
furiously—so agitatedly, as though to tumble over at every peal....
Maria’s heart became an echo of the bell. It fluttered in its piteous
fear, which had no source other than the general vibration of terror
above the town. Even the warming flames of the fire frightened her,
as if they had some knowledge of secrets of Horror.
She sat up and put her feet to the ground. She felt the hem of her
dress. It was still rather wet but she would go now. She took a few
steps through the dimly-lighted room. How brown the air was
outside the windows.... She hesitatingly opened the nearest door
and listened....
She was standing in the room in which she had stood on the day
when she saw Freder for the first time, when she had led the train of
little, grey child-spectres to those who were care-free and joyous—
when she had called to Freder’s heart with her gentle:
“Look, these are your brothers!”
But of all the dearly beloved sons of boundlessly wealthy fathers, to
whom this house belonged, not one was to be seen. They must have
left the tottering town long ago.
Sparsely distributed candles were burning, giving the room an
inward cosiness and a warm air of comfort. The room was filled with
the tender twittering of sleepy child-voices, chattering like swallows
before they fly to their nests.
Answering them in tones which were but little darker, came the
voices of the beautiful, brocaded, painted women, who had once
been the playthings of the sons. Equally frightened at the thought of
flight as of remaining where they were, they eventually stayed in the
“House of the Sons,” being still undecided; and Maria had brought
the children to them, because they could have found no better
refuge; for, by the beautiful and dreadful chance of all that had
taken place, the troup of loving little harlots became a troup of
loving little mothers, burning with a new fire in the execution of their
new duties.
Not far from Maria the little drink-mixer was kneeling, washing the
skinny slender-limbed body of Grot’s daughter, who was standing in
front of her. But the child had taken the sponge from her hand, and,
without saying a word, proceeding with intense gravity, was
thoughtfully and untiringly washing the beautiful, painted face of the
drink-mixer.
The girl knelt quite still, her eyes closed, neither did she move when
the child’s hands began to dry her face with the rough towel. But
Grot’s daughter was not quite successful in this undertaking; for,
whenever she dried the girl’s cheeks, again and again did the swift,
bright drops run over them. Until Grot’s daughter dropped the towel
to look at the girl who was kneeling before her inquiringly, and not
without reproach. Upon which the girl caught the child in her arms,
pressing her forehead to the heart of the silent creature, uttering to
this heart words of love which she had never found before.
Maria passed by with soundless step.
But when the door to the hall, into which no noise from the noisy
Metropolis could penetrate, closed behind her, the ore-voice of the
angel of the cathedral struck at her breast like a fist of steel, that
she stood still, stunned, raising her hands to her head.
Why was Saint Michael crying out so angrily and wildly? Why was
the roar of Azrael, the angel of Death joining in so alarmingly?
She stepped into the street. Darkness, like a thick layer of soot, lay
over the town, and only the cathedral shimmered, ghost-like, a
wonder of light, but not of grace.
The air was filled with a spectral battle of discordant voices.
Howling, laughing, whistling, were to be heard. It was as though a
gang of murderers and robbers were passing by—in the
unrecognisable depths of the street. Mingled with them, shrieks of
women, wild with excitement....
Maria’s eyes sought the New Tower of Babel. She had only one way
in her mind: to Joh Fredersen. She would go there. But she never
went.
For suddenly the air was a blood-red stream, which poured itself
forth, flickering, formed by a thousand torches. And the torches
were dancing in the hands of beings who were crowding out of
Yoshiwara. The faces of the beings shone with insanity, every mouth
parted in a gasp, yet the eyes which blazed above them were the
bursting eyes of men choking. Each was dancing the dance of Death
with his own torch, whirling madly about, and the whirl of the
dancers formed a train, revolving in itself.
“Maohee—!” flew the shrill cries above it. “Dance—dance—dance—
Maohee—!”
But the flaming procession was led by a girl. The girl was Maria. And
the girl was screaming with Maria’s voice:
“Dance—dance—dance—Maohee!”
She crossed the torches like swords above her head. She swung
them right and left, brandishing them so that showers of sparks fell
about the way. Sometimes it seemed as if she were riding on the
torches. She raised her knees to her breast, with laughter which
brought a moan from the dancers of the procession.
But one of the dancers ran along at the girl’s feet, like a dog, crying
incessantly:
“I am Jan! I am Jan! I am the faithful Jan! Hear me, at last, Maria!”
But the girl struck him in the face with her sparkling torch.
His clothes caught fire. He ran for some time, a living torch, along by
the girl. His voice sounded as if from the blaze:
“Maria—! Maria—!”
Then he swung himself up on to the parapet of the street and
hurled, a streak of fire, into the blackness of the depths.
“Maohee—! Maohee—!” called the girl, shaking her torch.
The procession was endless. The procession was endless. The street
was already covered, as far as the eye could see, with circling
torches. The shrieks of the dancers mixed themselves sharply and
shrilly with the angry voices of the archangels of the cathedral. And
behind the train, as though tugged along by invisible, unbreakable
cords, there reeled a girl, the damp hem of the hose dress lashed
about her ankles, whose hair was falling loose under the clawing
fingers which she pressed to her head, whose lips babbled a name in
ineffectual entreaty: “Freder.... Freder.....”
The smoke-swathes from the torches hovered like the grey wings of
phantom birds above the dancing train.
Then the door of the cathedral was opened wide. From the depths
of the cathedral came the rushing of the organ. There mixed itself in
the fourfold tone of the archangel bells, in the rushing of the organ,
in the shrieks of the dancers, an iron-tramping, mighty choir.
The hour of the monk Desertus had come.
The monk Desertus was leading on his own.
Two by two walked those who were his disciples. They walked on
bare feet, in black cowls. They had thrown their cowls back from
their shoulders. They carried the heavy scourges in both hands.
They swung the heavy scourges in both hands, right and left, right
and left, upon the bare shoulders. Blood trickled down from the
scourged backs. The Gothics sang. They sang to the time of their
feet. To the time of their scourge strokes did they sing.
The monk Desertus was leading the Gothics on.
The Gothics bore a black cross before them. It was so heavy that
twelve men had to carry it, pantingly. It swayed, held up by dark
cords.
And on the cross hung the monk Desertus.
The black flames of the eyes in the flame-white face were fixed upon
the procession of dancers. The head was raised. The pale mouth
was opened.
“See!” shouted the monk Desertus in a voice which all-powerfully
out-rang, the fourfold tone of the archangel bells, the rushing of the
organ, the choir of scourge-swingers and the shrieks of the dancers:
“See—! Babylon, the great—! The Mother of Abominations—!
Doomsday is breaking—! The destruction of the world—!”
“Doomsday is breaking—! The destruction of the world—!” chanted
the choir of his followers after him.
“Dance—dance—dance—Maohee—!” shrieked the voice of the girl
leading the dancers. And she swung her torches over her shoulders,
and hurled them far from her. She tore her gown from shoulders and
breasts, standing, a white torch, stretching up her arms and
laughing, shaking her hair; “Dance with me, Desertus—dance with
me—!”
Then the girl, dragging herself along at the end of the train, felt that
the cord, the invisible cord upon which she was hanging, snapped.
She turned around and began, not knowing, whither, to run—only to
get away—only to get away—no matter where to—only to get away
—!
The streets flashed by in a whirl. She ran and ran, down, and down,
and at last she saw, running along the bottom of the street and
towards her, a wild mob of people, saw, too, that the men wore the
blue linen uniform and sobbed in relief:
“Brothers—brothers—!”
And stretched out her hands.
But a furious roar answered her. Like a collapsing wall, the mass
hurled itself forward, shook itself loose and began to tear along,
roaring loudly.
“There she is—! There she is—! The bitch, who is to blame for it all
—! Take her—! Take her—!”
The women’s voices shrieked:
“The witch—! Kill the witch—! Burn her before we all drown!”
And the trampling of running feet filled the dead street, through
which the girl fled, with the din of hell broken loose.
The houses flashed by in a whirl. She did not know the way in the
dark. She sped on, running aimlessly, in a blind horror, which was
the deeper for her not knowing its origin.
Stones, cudgels, fragments of steel, flew at her from behind. The
mob roared in a voice which was no longer human:
“After her—! After her—! She’ll escape us—! Quicker—!! Quicker—!!”
Maria could no longer feel her feet. She did not know if she was
running on stones or water. Her panting breath came through lips
which stood apart as those of one drowning. Up streets, down
streets.... A twirling dance of lights was staggering across the way,
far ahead of her.... Far away, at the end of the enormous square, in
which Rotwang’s house also lay, the mass of the cathedral rested
upon the earth, weighty and dark, yet showing a tender, reassuring
shimmer, which fell through cheerful stained-glass windows and
through open portal, out into the darkness.
Suddenly breaking out into sobs, Maria threw herself forward with
her last, entirely despairing strength. She stumbled up the cathedral
steps, stumbled through the portal, perceived the odour of incense,
saw little, pious candles of intercession before the image of a gentle
saint who was suffering smilingly, and collapsed on to the flags.
She no longer saw how, at the double opening of the street which
led to the cathedral, the stream of dancers from Yoshiwara coincided
with the roaring stream of workmen and women, did not hear the
bestial shriek of the women at the sight of the girl who was riding
along on the shoulders of a dancer—who was torn down, overtaken,
captured and stamped to earth—did not see the short, ghastly
hopeless conflict of the men in evening dress with the men in blue
linen—nor the ridiculous fight of the half-naked women before the
claws and fists of the workmen’s wives.
She lay in deep oblivion, in the great, mild solemnity of death, and
from the depths of her unconsciousness she was not awakened even
by the roaring voice of the mob which was erecting a bonfire for the
witch, before the cathedral.
CHAPTER XX
“Freder—!!! Grot—!!! Freder—!!!”
Josaphat shouted so that his voice cracked, and raced with the
bounds of a harried wolf, through passages, across steps of the
great pump-works. His shouts were not heard. In the machine-
rooms were wounded machines in agony, wanting to obey and not
being able. The door was closed. Josaphat hammered against it with
his fists, with his feet. It was Grot who opened it to him, revolver in
hand.
“What in the name of seething hell....”
“Get out of the way—! Where’s Freder—?”
“Here! What’s the matter?”
“Freder, they’ve taken Maria captive—”
“What?”
“They’ve taken Maria captive and they’re killing her—!”
Freder reeled. Josaphat dragged him towards the door. Like a log,
Grot stood in his way, his lips mumbling, his eyes glaring.
“The woman who killed my machine—!”
“Shut up, you fool—get out of the way!”
“Grot!” A sound born half of madness....
“Yes, Mr. Freder!”
“You stop with the machines!”
“Yes, Mr. Freder!”
“Come on, Josaphat—!”
The sound of running, running, retreating, ghost-like.
Grot turned round. He saw the paralysed machines. He lifted his arm
and struck the machine with the full of his fist, as one strikes a
stubborn horse between the eyes.
“The woman,” he shouted with a howl, “who saved my little children
—!”
And he flung himself upon the machine with grinding teeth....
“Tell me—!” said Freder, almost softly. It was as if he did not want to
waste an atom of strength. His face was a white stone in which his
two eyes flamed like jewels. He jumped to the wheel of the little car
in which Josaphat had come. For the pump-works lay at the extreme
end of the great Metropolis.
It was still night.
The car started.
“We must go terribly out of our way,” said Josaphat, fixing the
flashlight. “Many bridges between the houseblocks are blown up....”
“Tell me,” said Freder. His teeth met, chattering, as if he were cold.
“I don’t know who found it out.... Probably the women, who were
thinking of their children and wanted to get home. You can’t get
anything out of the raving multitude. But anyway: When they saw
the black water running towards them from the shafts of the
underground railway, and when they realised that the pump-works,
the safe-guard of their city, had been destroyed by the stopping of
the machines, then they went mad with despair. They say that some
mothers, blind and deaf to all remonstrance, tried, as if possessed,
to dive down through the flooded shafts, and just the terrible
absoluteness of the futility of any attempt at rescue has turned them
into beasts and they lust for revenge....”
“Revenge ... on whom?”
“On the girl who seduced them....”
“On the girl...?”
“Go on....”
“Freder, the engine can’t keep up that speed....”
“Go on....”
“I do not know how it happened that the girl ran into their hands. I
was on my way to you when I saw a woman running across the
cathedral square, with her hair flying, the roaring rabble behind her.
There has been the very hell of a night anyway. The Gothics are
parading through the town scourging themselves, and they have put
the monk Desertus on the cross. They are preaching: Doomsday had
come, and it seems that they have converted a good many already,
for September is crouching before the smoking ruins of Yoshiwara. A
troop of torch dancers joined itself to the flagellants and, with
frothing curses upon the Mother of Abominations, the great whore of
Babylon, they burned Yoshiwara down to the ground....”
“The girl, Josaphat—”
“She did not reach the cathedral, Freder, where she wanted to take
refuge. They overtook her on the steps because she fell on the steps
—her gown hung down in ribbons from her body. A woman, whose
white eyes were glowing with insanity shrieked out, as one inspired
with the gift of prophecy:
“'Look—! Look—! The saints have climbed down from their pedestals
and will not let the witch into the cathedral.’”
“And—”
“Before the cathedral they are erecting a bonfire on which to burn
the witch....”
Freder said nothing. He bent down lower. The car groaned and
leapt.
Josaphat buried his hand in Freder’s arm.
“Stop—for God’s sake!!!”
The car stopped.
“We must go to the left—don’t you see? The bridge has gone!”
“The next bridge?”
“Is impassable!”
“Listen....”
“What is there to hear—”
“Don’t you hear anything?”
“No....”
“You must hear it—!”
“But what, Freder—?”
“Shrieks ... distant shrieks....”
“I can’t hear anything....”
“But you must be able to hear it—!!”
“Won’t you drive on, Freder?”
“And don’t you see that the air over there is getting bright red?”
“From the torches, Freder....”
“They don’t burn so brightly....”
“Freder, we’re losing time here—!”
Freder did not answer. He was staring at the tatters of the iron
bridge which were dangling down into the ravine of the street. He
must cross over, yes, he must cross over, to get to the cathedral by a
short cut....
The frame-support of a ripped-open tower had fallen over from this
side of the street to the other, gleaming metallically in the uncertain
light of the fading night.
“Get out,” said Freder.
“Why?”
“Get out, I tell you....”
“I want to know why?”
“Because I’m going across there....”
“Across where?”
“Across the frame-support.”
“Going to drive across—?”
“Yes.”
“It’s suicide, Freder!”
“I didn’t ask you to accompany me. Get out!”
“I won’t permit it—it’s blazing lunacy!”
“The fire over there is blazing, man—!”
The words seemed not to come from Freder’s mouth.
Every wound of the dying city seemed to be roaring out of him.
“Drive on!” said Josaphat through clenched teeth.
The car gave a jump. It climbed. The narrow irons received the
sucking, skidding wheels, with an evil, maliciously hypocritical sound.
Blood was trickling from Freder’s lips.
“Don’t—don’t put the brake on—for God’s sake don’t put the brake
on!” shouted the man beside him making a clutch of madness at
Freder’s hand. The car, already half-slipping, shot forward again. A
split in the frame-work—over, onwards. Behind them the dead
frame-work crashed into space amid shrieks.
They reached the other side with an impetus which was no longer to
be checked. The wheels rushed into blackness and nothing. The car
over-turned. Freder fell and got up again. The other remained lying.
“Josaphat—!!”
“Run! It’s nothing!—I swear to God it’s nothing!” a distorted smile
upon the white face. “Think of Maria—and run!”
And Freder raced off.
Josaphat turned his head. He saw the blackness of the street
flashing bright red. He heard the screams of the thousands. He
thought dully, with a thrust of his fist in the air: “Shouldn’t I like to
be Grot now, to be able to swear properly....”
Then his head fell back into the filth of the street, and every
consciousness faded but that of pain....
But Freder ran as he had never run. It was not his feet which carried
him. It was his wild heart—it was his thoughts.
Streets and stairs and streets and at last the cathedral square. Black
in the background, the cathedral, ungodded, unlighted, the place
before the broad steps swarming with human beings—and amid
them, surrounded by gasps of madly despairing laughter, the
howling of songs of fury, the smouldering of torches and brands,
high up on the pyre....
“Maria—!”
Freder fell on his knees as though his sinews were sawn through.
“Maria—!”
The girl whom he took to be Maria raised her head. She sought him.
Her glance found him. She smiled—laughed.
“Dance with me, my dearest—!” flew her voice, sharp as a flashing
knife, through uproar.
Freder got up. The mob recognised him. The mob lurched towards
him, shrieking and yelling.
“Jooooo—oh! Joh Fredersen’s son—! Joh Fredersen’s son—”
They made to seize him. He dodged them wildly. He threw himself
with his back against the parapet of the street.
“Why do you want to kill her, you devils—? She has saved your
children!”
Roars of laughter answered him. Women sobbed with laughter,
biting into their own hands.
“Yes—yes—she has saved our children—! She saved our children
with the song of the dead machines! She saved our children with the
ice cold water—! High let her live—high and three time high!”
“Go to the ‘House of the Sons’—! Your children are there!”
“Our children are not in the ‘House of the Sons!’ There lives the
brood, hatched out by money. Sons of your kind, you dog in white-
silken skin!”
“Listen, for God’s sake—do listen to me—!!!”
“We don’t want to hear anything—!”
“Maria—beloved!!!—Beloved!!!”
“Don’t bawl so, son of Joh Fredersen! Or we’ll stop your mouth!”
“Kill me, if you must kill—but let her live—!”
“Each in his turn, son of Joh Fredersen! First you shall see how your
beloved dies a beautiful, hot magnificent death!”
A woman—Grot’s woman—tore a strip off her skirt and bound
Freder’s hands. He was bound fast to the parapet with cords. He
struggled like a wild beast, shouting that the veins of this throat
were in danger of bursting. Bound, impotent, he threw back his
head and saw the sky over Metropolis, pure, tender, greenish-blue,
for morning would soon follow after this night.
“God—!” he shouted, trying to throw himself on his knees, in his
bonds. “God—! Where art thou—?”
A wild, red gleam caught his eyes. The pyre flamed up in long
flames. The men, the women, seized hands and tore around the
bonfire, faster, faster and faster, in rings growing ever wider and
wider, laughing, screaming with stamping feet, “Witch—! Witch!”
Freder’s bonds broke. He fell over on his face among the feet of the
dancers.
And the last he saw of the girl, while her gown and hair stood
blazing around her as a mantle of fire, was the loving smile and the
wonder of her eyes—and her mouth of deadly sin, which lured
among the flames:
“Dance with me, my dearest! Dance with me—!”
CHAPTER XXI
Rotwang awoke; but he knew quite well he was dead. And this
consciousness filled him with the deepest satisfaction. His aching
body no longer had anything to do with him. That was perhaps the
last remains of life. But something worried him deeply, as he raised
himself up and looked around in all directions: Hel was not there.
Hel must be found....
An existence without Hel was over at last. A second one?—No!
Better than to stay dead.
He got up on his feet. That was very difficult. He must have been
lying as a corpse for a good long time. It was night, too. A fire was
raging out there, and it was all very noisy.... Shrieking of human
beings....
Hm....
He had hoped to have been rid of them. But, apparently the
Almighty Creator could not get along without them. Now—but one
purpose. He just wanted his Hel. When he had found Hel, he would
—he promised himself this!—never again quarrel with the father of
all things, about anything at all....
So now he went.... The door leading to the street was open and
hanging crookedly on its hinges. Strange. He stepped in front of the
house and looked deliberatingly around. What he saw seemed to be
a kind of Metropolis; but a rather insane kind of Metropolis. The
houses seemed as though struck still in St. Vitus’ dance. And an
uncommonly rough and impolite sort of people was ramping around
a flaming bonfire, upon which a creature of rare beauty was
standing, seeming, to Rotwang, to be wondrously at ease.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like