100% found this document useful (7 votes)
74 views

Programming for Problem Solving- GTU 2018 - eBook PDF 2024 scribd download

PDF

Uploaded by

sereybanaga
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (7 votes)
74 views

Programming for Problem Solving- GTU 2018 - eBook PDF 2024 scribd download

PDF

Uploaded by

sereybanaga
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 69

Visit https://ebookluna.

com to download the full version and


explore more ebooks

Programming for Problem Solving- GTU 2018 - eBook


PDF

_____ Click the link below to download _____


https://ebookluna.com/download/programming-for-problem-
solving-ebook-pdf/

Explore and download more ebooks at ebookluna.com


Here are some recommended products that might interest you.
You can download now and explore!

(eBook PDF) Programming, Problem Solving and Abstraction


with C

https://ebookluna.com/product/ebook-pdf-programming-problem-solving-
and-abstraction-with-c/

ebookluna.com

Problem Solving and Python Programming 1st edition - eBook


PDF

https://ebookluna.com/download/problem-solving-and-python-programming-
ebook-pdf/

ebookluna.com

Programming and Problem Solving with Python 1st Edition -


eBook PDF

https://ebookluna.com/download/programming-and-problem-solving-with-
python-ebook-pdf/

ebookluna.com

(eBook PDF) Java: An Introduction to Problem Solving and


Programming 7th Edition

https://ebookluna.com/product/ebook-pdf-java-an-introduction-to-
problem-solving-and-programming-7th-edition/

ebookluna.com
(eBook PDF) Java: An Introduction to Problem Solving and
Programming 8th Edition

https://ebookluna.com/product/ebook-pdf-java-an-introduction-to-
problem-solving-and-programming-8th-edition/

ebookluna.com

Mathematics-1, GTU–2018 - eBook PDF

https://ebookluna.com/download/mathematics-1-gtu-2018-ebook-pdf/

ebookluna.com

(eBook PDF) Matlab: A Practical Introduction to


Programming and Problem Solving 4th Edition

https://ebookluna.com/product/ebook-pdf-matlab-a-practical-
introduction-to-programming-and-problem-solving-4th-edition/

ebookluna.com

(eBook PDF) Introduction to Programming with Java: A


Problem Solving Approach 3rd Edition

https://ebookluna.com/product/ebook-pdf-introduction-to-programming-
with-java-a-problem-solving-approach-3rd-edition/

ebookluna.com

(eBook PDF) Community Policing: Partnerships for Problem


Solving 8th Edition

https://ebookluna.com/product/ebook-pdf-community-policing-
partnerships-for-problem-solving-8th-edition/

ebookluna.com
PROGRAMMING
fOR
PRObleM SOlvING
Gujarat Technological University - 2018
About the Author

E Balagurusamy, is presently the Chairman of EBG Foundation, Coimbatore. In the past he has also held
the positions of member, Union Public Service Commission, New Delhi and Vice-Chancellor, Anna University,
Chennai. He is a teacher, trainer and consultant in the fields of Information Technology and Management.
He holds an ME (Hons) in Electrical Engineering and PhD in Systems Engineering from the Indian Institute
of Technology, Roorkee. His areas of interest include Object-Oriented Software Engineering, E-Governance:
Technology Management, Business Process Re-engineering and Total Quality Management.
A prolific writer, he has authored a large number of research papers and several books.
A recipient of numerous honors and awards, he has been listed in the Directory of Who's Who of Intellectuals
and in the Directory of Distinguished Leaders in Education.
PROGRAMMING
fOR
PRObleM SOlvING
Gujarat Technological University - 2018

E Balagurusamy
Chairman
EBG Foundation
Coimbatore

McGraw Hill Education (India) Private Limited


CHENNAI

McGraw Hill Education Offices


Chennai New York St Louis San Francisco Auckland Bogotá Caracas
Kuala Lumpur Lisbon London Madrid Mexico City Milan Montreal
San Juan Santiago Singapore Sydney Tokyo Toronto
McGraw Hill Education (India) Private Limited
Published by McGraw Hill Education (India) Private Limited
444/1, Sri Ekambara Naickr Industrial Estate, Alapakkam, Porur, Chennai-600 116

Programming for Problem Solving


Copyright © 2019 by McGraw Hill Education (India) Private Limited.
No part of this publication may be reproduced or distributed in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise or stored in a database or retrieval system without the prior written permission of
the publishers. The program listings (if any) may be entered, stored and executed in a computer system, but they may not
be reproduced for publication.
This edition can be exported from India only by the publishers,
McGraw Hill Education (India) Private Limited.
Print Edition
ISBN (13 digit): 978-93-5316-278-8
ISBN (10 digit): 93-5316-278-5
E-book Edition
ISBN (13 digit): 978-93-5316-279-5
ISBN (10 digit): 93-5316-279-3
1 23456789 D101417 22 21 20 19 18
Printed and bound in India.
Director—Science & Engineering Portfolio: Vibha Mahajan
Senior Portfolio Manager—Science & Engineering: Hemant K Jha
Associate Portfolio Manager —Science & Engineering: Tushar Mishra
Production Head: Satinder S Baveja
Copy Editor: Taranpreet Kaur
Assistant Manager—Production: Suhaib Ali
General Manager—Production: Rajender P Ghansela
Manager—Production: Reji Kumar

Information contained in this work has been obtained by McGraw Hill Education (India), from sources believed to be
reliable. However, neither McGraw Hill Education (India) nor its authors guarantee the accuracy or completeness of any
information published herein, and neither McGraw Hill Education (India) nor its authors shall be responsible for any errors,
omissions, or damages arising out of use of this information. This work is published with the understanding that McGraw
Hill Education (India) and its authors are supplying information but are not attempting to render engineering or other
professional services. If such services are required, the assistance of an appropriate professional should be sought.

Typeset at The Composers, 260, C.A. Apartment, Paschim Vihar, New Delhi 110 063 and printed at

Cover Printer:
Cover Designer: APS Compugraphics
Cover Image Source: Shutterstock
Visit us at: www.mheducation.co.in
Write to us at: [email protected]
CIN: U22200TN1970PTC111531
Toll Free Number: 1800 103 5875
Preface

P
rogramming for Problem Solving requires a deep understanding of C. C is a powerful, flexible, portable
and elegantly structured programming language. Since C combines the features of high-level language
with the elements of the assembler, it is suitable for both systems and applications programming. It
is undoubtedly the most widely used general-purpose language today in operating systems, and embedded
system development. Its influence is evident in almost all modern programming languages. Since its
standardization in 1989, C has undergone a series of changes and improvements in order to enhance the
usefulness of the language.

Organization of the Book


Programming for Problem Solving starts with an Introduction to Computer Programming, Chapter 2 discusses
fundamentals of C. Control Structures in C is presented in Chapter 3. Chapter 4 deals with Arrays and
Strings. Chapter 5 discusses Functions. In Chapter 6 students can study Pointers. While Chapter 7 details
Structure. Dynamic Memory Allocation is discussed in Chapter 8. Chapter 9 details on File Management.

Salient Features of the Book


∑ Learning Objectives
∑ Key Concepts
∑ Content Tagged with LO
∑ Worked Out Problems
∑ Tips
∑ Closing Vignette
∑ Review Exercises – True False, Fill in the blanks, Questions, Programming Exercises – categorized into
LO and Difficulty level (E for Easy, M for Medium and H for High)

Acknowledgements
I owe special thanks to the entire team of McGraw Hill Education India.
A note of acknowledgement is due to the following reviewers for their valuable feedback.

Ms. Kalpana Mudaliar Gandhinagar Institute of Technology, Gandhinagar, Gujarat


H K Patnaik Kalinga Institute of Industrial Technology, KIIT University, Bhubaneswar
T V Gopal College of Engineering, Anna University, Chennai, Tamil Nadu
Unnati Nitin Chaudhari Tolani Maritime Institute, Pune, Maharashtra
Tanveer Ahmed Jamia Millia Islamia, Delhi
Ravindra Divekar KJ Somaiya College of Engineering, Mumbai, Maharashtra
SC Dutta Birsa Institute of Technology, Sindri, Dhanbad, Jharkhand
D Lakshmi Adithya Institute of Technology, Coimbatore, Tamil Nadu
vi Preface

This book is my sincere attempt to make a footprint on the immensely vast and infinite sands of knowledge.
I would request the readers to utilize this book to the maximum extent.
E Balagurusamy

Publisher’s Note
McGraw Hill Education (India) invites suggestions and comments from you, all of which can be sent to info.
[email protected] (kindly mention the title and author name in the subject line).
Piracy-related issues may also be reported.
Contents

About the Author ii


Preface v

1. Introduction to Computer and Programming 1


Learning Objectives 1
Introduction 1
Generations of Computers 2
Classification of Computers 5
Basic Anatomy of a Computer System 7
Input Devices 8
Processor 9
Output Devices 10
Memory Management 12
Types of Computer Software 13
Overview of Operating System 14
MS Word 19
MS Excel System 21
MS Powerpoint System 22
Networking Concepts 23
Network Topologies 25
Network Protocols and Software 29
Decimal System 31
Binary System 32
Hexadecimal System 33
Octal System 34
Conversion of Numbers 35
Binary Arithmetic Operations 44
Logic Gates 52
Programming Languages 55
viii Contents

Translator Programs 58
Problem-Solving Techniques 59
Using the Computer 70
Learning Outcomes 70
Key Concepts 71
Review Questions 73
Discussion Questions 84

2. Fundamentals of C 87
Learning Objectives 87
History of C 87
Importance of C 89
Sample Program 1: Printing a Message 89
Sample Program 2: Adding Two Numbers 92
Sample Program 3: Interest Calculation 93
Sample Program 4: Use of Subroutines 95
Sample Program 5: Use of Math Functions 96
Basic Structure of C Programs 97
Programming Style 98
Executing a ‘C’ Program 99
UNIX System 99
MS-DOS System 102
Key Concepts 102
Always Remember 103
Review Questions 103
Debugging Exercises 105
Programming Exercises 105

3. Control Structure in C 107


Learning Objectives 107
Introduction 107
Decision Making with if Statement 108
Simple If Statement 108
The If.....Else Statement 111
Nesting of If....Else Statements 114
The Else If Ladder 117
The Switch Statement 121
The ? : Operator 125
The goto Statement 129
Key Concepts 132
Contents ix

Always Remember 132


Brief Cases 132
Review Questions 137
Debugging Exercises 141
Programming Exercises 141

4. Array & String 145


Learning Objectives 145
Introduction 145
One-Dimensional Arrays 147
Declaration of One-dimensional Arrays 148
Initialization of One-dimensional Arrays 151
Two-Dimensional Arrays 156
Initializing Two-dimensional Arrays 161
Multi-dimensional Arrays 168
Dynamic Arrays 169
More About Arrays 170
Declaring and Initializing String Variables 170
Reading Strings from Terminal 171
Writing Strings to Screen 177
Arithmetic Operations on Characters 181
Putting Strings Together 183
Comparison of Two Strings 184
String-Handling Functions 184
Table of Strings 190
Other Features of Strings 192
Key Concepts 192
Always Remember 193
Brief Cases 194
Review Questions 210
Debugging Exercises 214
Programming Exercises 215

5. Functions 220
Learning Objectives 220
Introduction 220
Need for User-Defined Functions 221
A Multi-Function Program 221
Elements of User-Defined Functions 224
x Contents

Definition of Functions 224


Return Values and Their Types 227
Function Calls 228
Function Declaration 229
Category of Functions 231
No Arguments and No Return Values 231
Arguments but No Return Values 233
Arguments with Return Values 236
No Arguments but Returns a Value 241
Functions that Return Multiple Values 242
Nesting of Functions 243
Recursion 244
Passing Arrays to Functions 245
Passing Strings to Functions 250
The Scope, Visibility and Lifetime of Variables 251
Multifile Programs 260
Key Concepts 262
Always Remember 262
Brief Cases 263
Review Questions 266
Debugging Exercises 270
Programming Exercises 270

6. Pointers 273
Learning Objectives 273
Introduction 273
Understanding Pointers 274
Accessing the Address of a Variable 276
Declaring Pointer Variables 277
Initialization of Pointer Variables 278
Accessing a Variable Through its Pointer 279
Chain of Pointers 281
Pointer Expressions 282
Pointer Increments and Scale Factor 284
Pointers and Arrays 284
Pointers and Character Strings 288
Array of Pointers 290
Pointers as Function Arguments 291
Functions Returning Pointers 294
Visit https://ebookluna.com
now to explore a diverse
collection of ebooks available
in formats like PDF, EPUB, and
MOBI, compatible with all
devices. Don’t miss the chance
to enjoy exciting offers and
quickly download high-quality
materials in just a few simple
steps!
Contents xi

Pointers to Functions 295


Pointers and Structures 297
Troubles with Pointers 299
Key Concepts 300
Always Remember 300
Brief Cases 301
Review Questions 306
Debugging Exercises 309
Programming Exercises 309

7. Structure 311
Learning Objectives 311
Introduction 311
Defining a Structure 312
Declaring Structure Variables 313
Accessing Structure Members 315
Structure Initialization 316
Copying and Comparing Structure Variables 318
Operations on Individual Members 320
Arrays of Structures 320
Arrays within Structures 323
Structures within Structures 324
Structures and Functions 326
Unions 329
Size of Structures 330
Bit Fields 330
Key Concepts 333
Always Remember 333
Brief Cases 334
Review Questions 338
Debugging Exercises 341
Programming Exercises 341

8. Dynamic Memory Allocation 344


Learning Objectives 344
Introduction 344
Dynamic Memory Allocation 344
Allocating a Block of Memory: malloc 345
Allocating Multiple Blocks of Memory: calloc 347
xii Contents

Releasing the Used Space: free 348


Altering the Size of a Block: realloc 348
Concepts of Linked Lists 350
Advantages of Linked Lists 353
Types of Linked Lists 354
Pointers Revisited 354
Creating a Linked List 356
Inserting an Item 360
Deleting an Item 363
Application of Linked Lists 365
Key Concepts 365
Always Remember 366
Brief Cases 366
Review Questions 372
Debugging Exercises 374
Programming Exercises 374

9. File Management 376


Learning Objectives 376
Introduction 376
Defining and Opening a File 377
Closing a File 378
Input/Output Operations on Files 379
Error Handling During I/O Operations 385
Random Access to Files 387
Command Line Arguments 394
Key Concepts 396
Always Remember 396
Review Questions 397
Debugging Exercises 398
Programming Exercises 398
Roadmap to the Syllabus
Programming For Problem Solving
Code: 3110003

Introduction to computer and programming: Introduction, Basic block diagram and functions of various
components of computer, Concepts of Hardware and software, Types of software, Compiler and interpreter,
Concepts of Machine level, Assembly level and high level programming, Flowcharts and Algorithms

GO TO Chapter 1 Introduction to Computer and Programming

Fundamentals of C: Features of C language, structure of C Program, comments, header files, data types,
constants and variables, operators, expressions, evaluation of expressions, type conversion, precedence
and associativity, I/O functions

GO TO Chapter 2 Fundamentals of C

Control structure in C: Simple statements, Decision making statements, Looping statements, Nesting of
control structures, break and continue, goto statement

GO TO Chapter 3 Control Structure in C

Array & String: Concepts of array, one and two dimensional arrays, declaration and initialization of arrays,
string, string storage, Built-in-string functions
Recursion: Recursion, as a different way of solving problems. Example programs, such as Finding
Factorial, Fibonacci series, Ackerman function etc. Quick sort or Merge sort.

GO TO Chapter 4 Array & String


xiv Roadmap to the Syllabus

Functions: Concepts of user defined functions, prototypes, definition of function, parameters, parameter
passing, calling a function, recursive function, Macros, Pre-processing

GO TO Chapter 5 Functions

Pointers: Basics of pointers, pointer to pointer, pointer and array, pointer to array, array to pointer, function
returning pointer

GO TO Chapter 6 Pointers

Structure: Basics of structure, structure members, accessing structure members, nested structures, array
of structures, structure and functions, structures and pointers

GO TO Chapter 7 Structure

Dynamic memory allocation: Introduction to Dynamic memory allocation, malloc, calloc

GO TO Chapter 8 Dynamic Memory Allocation

File management: Introduction to file management and its functions

GO TO Chapter 9 File Management


Introduction to
Chapter
Computer and
Programming 1
LEARNING OBJECTIVES
LO 1.1 Identify the various generations of computers
LO 1.2 Classify computers on the basis of different criteria
LO 1.3 Describe the computer system
LO 1.4 Classify various computer software
LO 1.5 Discuss various operating systems
LO 1.6 Discuss Microsoft software
LO 1.7 Know various networking concepts and protocols
LO 1.8 Identify the various positional number systems
LO 1.9 Carry out number conversions from one number system to another
LO 1.10 Explain how binary arithmetic operations are performed
LO 1.11 Describe primary logic gates
LO 1.12 Discuss various levels of programming languages
LO 1.13 Know various problem solving techniques and computer applications

introduction
A computer is an electronic machine that takes input from the user, processes the given input and generates
output in the form of useful information. A computer accepts input in different forms such as data, programs
and user reply. Data refer to the raw details that need to be processed to generate some useful information.
Programs refer to the set of instructions that can be executed by the computer in sequential or non-
sequential manner. User reply is the input provided by the user in response to a question asked by the
computer.
A computer includes various devices that function as an integrated system to perform several tasks
described above (Fig. 1.1). These devices are:
Central Processing Unit (CPU)
It is the processor of the computer that is responsible for controlling and executing instructions in the computer.
It is considered as the most significant component of the computer.
2 Programming for Problem Solving

Monitor
It is a screen, which displays information in visual form, after receiving the video signals from the computer.
Keyboard and Mouse
These are the devices, which are used by the computer, for receiving input from the user.

Fig. 1.1 The components of computer

Computers store and process numbers, letters and words that are often referred to as data.
l How do we communicate data to computers?
l How do the computers store and process data?
Since the computers cannot understand the Arabic numerals or the English alphabets, we should use
some ‘codes’ that can be easily understood by them.
In all modern computers, storage and processing units are made of a set of silicon chips, each contain-
ing a large number of transistors. A transistor is a two-state device that can be put ‘off’ and ‘on’ by passing
an electric current through it. Since the transistors are sensitive to currents and act like switches, we can
communicate with the computers using electric signals, which are represented as a series of ‘pulse’ and
‘no-pulse’ conditions. For the sake of convenience and ease of use, a pulse is represented by the code ‘1’
and a no-pulse by the code ‘0’. They are called bits, an abbreviation of ‘binary digits’. A series of 1s and
0s are used to represent a number or a character and thus they provide a way for humans and computers
to communicate with one another. This idea was suggested by John Von Neumann in 1946. The numbers
represented by binary digits are known as binary numbers. Computers not only store numbers but also
perform operations on them in binary form.
In this chapter, we discuss how the numbers are represented using what are known as binary codes, how
computers perform arithmetic operations using the binary representation, how digital circuits known as logic
gates are used to manipulate data, how instructions are designed using what are known as programming
languages and how algorithms and flow charts might help us in developing programs.

generations of computers
The history of computer development is often discussed in terms of different LO 1.1
generation of computers, as listed below. Identify the various
l First generation computers generations
l Second generation computers of computers
l Third generation computers
l Fourth generation computers
l Fifth generation computers
Introduction to Computer and Programming 3

These computers used the vacuum tubes


technology (Fig. 1.2) for calculation as well as
for storage and control purposes. Therefore,
these computers were also known as vacuum
tubes or thermionic valves based machines.
Some examples of first generation computers
are ENIAC, EDVAC, EDSAC and UNIVAC.
Advantages
l Fastest computing devices of their time.
l Able to execute complex mathematical
problems in an efficient manner.
Disadvantages
l These computers were not very easy to
program being machine dependent.
l They were not very flexible in running
different types of applications as designed
for special purposes.
l The use of vacuum tube technology made
these computers very large and bulky and
also required to be placed in cool places.
l They could execute only one program at a
time and hence, were not very productive.
l They generated huge amount of heat and
hence were prone to hardware faults.
Fig. 1.2 A vacuum tube

These computers use transistors in place of vacuum tubes in building


the basic logic circuits. A transistor is a semiconductor device that is
used to increase the power of the incoming signals by preserving the
shape of the original signal (Fig. 1.3).
Some examples of second generation computers are PDP-8, IBM
1401 and IBM 7090.
Advantages
l Fastest computing devices of their time.
l Easy to program because of the use of assembly language.
l Small and light weight computing devices.
l Required very less power in carrying out operations.
Disadvantages
l Input and output media for these computers were not improved
to a considerable extent.
l Required to be placed in air-conditioned places. Fig. 1.3 A transistor
4 Programming for Problem Solving

l Very expensive and beyond the reach of home users.


l Being special-purpose computers they could execute only specific applications.

The major characteristic feature of third generation


computer systems was the use of Integrated Circuits
(ICs). ICs are the circuits that combine various electronic
components, such as transistors, resistors, capacitors, etc.
onto a single small silicon chip.
Some examples of third generation computers are NCR
395, B6500, IBM 370, PDP 11 and CDC 7600.
Advantages
l Computational time for these computers was usually
in nanoseconds hence were the fastest computing
devices
l Easily transportable because of their small size.
l They used high-level languages which is machine
independent hence very easy to use. Fig. 1.4 An integrated circuit
l Easily installed and required less space.
l Being able to execute any type of application (business and scientific) these were considered as
general-purpose computers.
Disadvantages
l Very less storage capacity.
l Degraded performance while executing complex computations because of the small storage capacity.
l Very expensive.

The progress in LSI and VLSI technologies led to the development of microprocessor, which became the
major characteristic feature of the fourth generation
computers. The LSI and VLSI technology allowed
thousands of transistors to be fitted onto one small silicon
chip.
A microprocessor incorporates various components
of a computer—such as CPU, memory and Input/Output
(I/O) controls—onto a single chip. Some popular later
microprocessors include Intel 386, Intel 486 and Pentium.
Some of the examples of fourth generation computers
are IBM PC, IBM PC/AT, Apple and CRAY-1.
Advantages
l LSI and VLSI technologies made them small,
cheap, compact and powerful.
l high storage capacity
l highly reliable and required very less maintenance. Fig. 1.5 The Intel P4004 microprocessor chip
Introduction to Computer and Programming 5

l provided a user-friendly environment with the development of GUIs and interactive I/O devices.
l programs written on these computers were highly portable because of the use of high-level languages.
l very versatile and suitable for every type of applications.
l required very less power to operate.
Disadvantages
l the soldering of LSI and VLSI chips on the wiring board was complicated
l still dependent on the instructions given by the programmer.

Fifth generation computers are based on the Ultra Large Scale Integration (ULSI) technology that allows
almost ten million electronic components to be fabricated on one small chip.
Advantages
l faster, cheaper and most efficient computers till date.
l They are able to execute a large number of applications at the same time and that too at a very high
speed.
l The use of ULSI technology helps in decreasing the size of these computers to a large extent.
l very comfortable to use because of the several additional multimedia features.
l versatile for communications and resource sharing.
Disadvantage
They are not provided with an intelligent program that could guide them in performing different operations.
Figure 1.6 shows a tree of computer family that illustrates the area-wise developments during the last
four decades and their contributions to the various generations of computers.

classification of computers
Computers can be classified into several categories depending on their LO 1.2
computing ability and processing speed. These include Classify computers on
l Microcomputer the basis of different
l Minicomputer criteria
l Mainframe computers
l Supercomputers
Microcomputers
A microcomputer is defined as a computer that has a microprocessor as its CPU and can perform the
following basic operations:
l Inputting — entering data and instructions into the microcomputer system.
l Storing — saving data and instructions in the memory of the microcomputer system, so that they can
be use whenever required.
l Processing — performing arithmetic or logical operations on data, where data, such as addition,
subtraction, multiplication and division.
l Outputting — It provides the results to the user, which could be in the form of visual display and/or
printed reports.
l Controlling — It helps in directing the sequence and manner in which all the above operations are
performed.
Minicomputers
A minicomputer is a medium-sized computer that is more powerful than a microcomputer. It is usually
designed to serve multiple users simultaneously, hence called a multiterminal, time-sharing system.
6 Programming for Problem Solving

Fig. 1.6 Tree of computer family


Visit https://ebookluna.com
now to explore a diverse
collection of ebooks available
in formats like PDF, EPUB, and
MOBI, compatible with all
devices. Don’t miss the chance
to enjoy exciting offers and
quickly download high-quality
materials in just a few simple
steps!
Introduction to Computer and Programming 7

Minicomputers are popular among research and business organizations today. They are more expensive
than microcomputers.
Mainframe Computers
Mainframe computers help in handling the information processing of various organizations like banks,
insurance companies, hospitals and railways. Mainframe computers are placed on a central location and
are connected to several user terminals, which can act as access stations and may be located in the same
building. Mainframe computers are larger and expensive in comparison to the workstations.
Supercomputers
In supercomputers, multiprocessing and parallel processing technologies are used to promptly solve
complex problems. Here, the multiprocessor can enable the user to divide a complex problem into smaller
problems. A supercomputer also supports multiprogramming where multiple users can access the computer
simultaneously. Presently, some of the popular manufacturers of supercomputers are IBM, Silicon Graphics,
Fujitsu, and Intel.

Basic anatomy of a computer system


A computer system comprises hardware and software components. Hardware refers to the physical
parts of the computer system and software is the set of instructions or programs that are necessary for the
functioning of a computer to perform certain tasks. Hardware includes the following components:
l Input devices — They are used for accepting the data on which the operations are to be performed.
The examples of input devices are keyboard, mouse and track ball.

Magnetic Magnetic
Tape Disk

EXTERNAL STORAGE UNITS

Input Input Memory Output Output


Media Unit Unit Unit Media

Arithmetic
Unit

Control
Unit

CPU
Data and results flow
Control Instructions to units
Instructions to control unit
Fig. 1.7 Interaction among hardware components
8 Programming for Problem Solving

l Processor — Also known as CPU, it is used to perform the calculations and information processing
on the data that is entered through the input device.
l Output devices — They are used for providing the output of a program that is obtained after
performing the operations specified in a program. The examples of output devices are monitor and
printer.
l Memory — It is used for storing the input data as well as the output of a program that is obtained
after performing the operations specified in a program. Memory can be primary memory as well as
secondary memory. Primary memory includes Random Access Memory (RAM) and secondary
memory includes hard disks and floppy disks.
Software supports the functioning of a computer system internally and cannot be seen. It is stored on
secondary memory and can be an application software as well as system software. The application
software is used to perform a specific task according to requirements and the system software (operating
system and networking system) is mandatory for running application software.

input DeVices
LO 1.3
Input devices are electromechanical devices that are used to provide data
Describe the computer
to a computer for storing and further processing, if necessary. Depending
system
upon the type or method of input, the input device may belong to one of the
following categories:

Keyboard is used to type data and text and execute commands. A standard keyboard, as shown in Fig. 1.8,
consists of the following groups of keys:

Fig. 1.8 The presently used keyboard


Alphanumeric Keys include the number keys and alphabet keys arranged in QWERTY layout.
Function Keys help perform specific tasks, such as searching a file or refreshing a web page.
Central Keys include arrow keys (for moving the cursor) and modifier keys such as SHIFT, ALT and CTRL
(for modifying the input).
Introduction to Computer and Programming 9

Numeric Keypad looks like a calculator’s keypad with its 10 digits and mathematical operators.
Special Purpose Keys The special purpose keys help perform a certain kind of operation, like exiting a
program (Escape) or deleting some characters (Delete) in a document, etc.

Mouse is a small hand-held pointing device that basically controls the two-dimensional movement of the
cursor on the displayed screen. It is an important part of the Graphical User Interface (GUI) based Operating
Systems (OS) as it helps in selecting a portion of the screen and copying and pasting the text.
The mouse, on moving, also moves the pointer appearing on the display device (Fig. 1.9).
Wheel
Right Button
Left Button

Fig. 1.9 A mechanical mouse

Scanning devices are the input devices that can electronically


capture text and images, and convert them into computer readable
form (Fig. 1.10).
There are the following types of scanners that can be used to
produce digitized images:
l Flatbed scanner — It contains a scanner head that moves
across a page from top to bottom to read the page and
converts the image or text available on the page in digital
form. The flatbed scanner is used to scan graphics, oversized
documents, and pages from books.
l Drum scanner — In this type of scanner, a fixed scanner
head is used and the image to be scanned is moved across Fig. 1.10 A Scanner
the head. The drum scanners are used for scanning prepress
materials.
l Slide scanner — It is a scanner that can scan photographic slides directly to produce files
understandable by the computer.
l Handheld scanner — It is a scanner that is moved by the end user across the page to be scanned.
This type of scanner is inexpensive and small in size.

processor
The CPU consists of Control Unit (CU) and ALU. CU stores the instruction set, which specifies the
operations to be performed by the computer. CU transfers the data and the instructions to the ALU for
10 Programming for Problem Solving

an arithmetic operation. ALU performs arithmetical or logical operations on the data received. The CPU
registers store the data to be processed by the CPU and the processed data also. Apart from CU and ALU,
CPU seeks help from the following hardware devices to process the data:
Motherboard
It refers to a device used for connecting the CPU with the input and output devices. The components on the
motherboard are connected to all parts of a computer and are kept insulated from each other. Some of
the components of a motherboard are:
l Buses: Electrical pathways that transfer data and instructions among different parts of the computer.
For example, the data bus is an electrical pathway that transfers data among the microprocessor,
memory and input/output devices connected to the computer.
l System clock: It is a clock used for synchronizing the activities performed by the computer. The
electrical signals that are passed inside a computer are timed, based on the tick of the clock.
l Microprocessor: CPU component that performs the processing and controls the activities performed
by the different parts of the computer.
l ROM: Chip that contains the permanent memory of the computer that stores information, which cannot
be modified by the end user.
RAM
It refers to primary memory of a computer that stores information and programs, until the computer is used.
RAM is available as a chip that can be connected to the RAM slots in the motherboard.
Video Card/Sound Card
The video card is an interface between the monitor and the CPU. Video cards also include their own RAM
and microprocessors that are used for speeding up the processing and display of a graphic. A sound card is
a circuit board placed on the motherboard and is used to enhance the sound capabilities of a computer.

output DeVices
The main task of an output device is to convert the machine-readable information into human-readable form
which may be in the form of text, graphics, audio or video.

A monitor produces visual displays generated by the computer. The monitor is connected to the video card
placed on the expansion slot of the motherboard.

Fig. 1.11 A CRT monitor and the internal components of a CRT


Introduction to Computer and Programming 11

The monitors can be classified as cathode ray tube (CRT) monitors or liquid crystal display (LCD)
monitors. The CRT monitors are large, occupy more space in the computer, whereas LCD monitors are thin,
light weighted, and occupy lesser space. Both the monitors are available as monochrome, gray scale and
color models.
A monitor can be characterized by its monitor size and resolution. The monitor size is the length of the
screen that is measured diagonally. The resolution of the screen is expressed as the number of picture
elements or pixels of the screen. The resolution of the monitor is also called the dot pitch. The monitor with a
higher resolution produces a clearer image.

The printer is an output device that transfers the text displayed on the screen, onto paper sheets that can
be used by the end user. Printers can be classified based on the technology they use to print the text and
images:
l Dot matrix printers — Dot matrix printers are impact printers that use perforated sheet to print the
text. Dot matrix printers are used to produce multiple copies of a print out.
l Inkjet printers — Inkjet printers are slower than dot matrix printers and are used to generate high
quality photographic prints.
l Laser printers — The laser printer may or may not be connected to a computer, to generate an
output. These printers consist of a microprocessor, ROM and RAM, which can be used to store the
textual information.

These systems record the simple messages in human speech form and then combine all these simple
messages to form a single message. The voice response system is of two types—one uses a reproduction
of human voice and other sounds, and the other uses speech synthesis.
The basic application of a voice output system is in Interactive Voice Response (IVR) systems, which are
used by the customer care or customer support departments of an organization, such as telecommunication
companies, etc.

A projector is a device that is connected to a


computer or a video device for projecting an
image from the computer or video device onto
the big white screen. The images projected
by a projector are larger in size as compared
to the original images. A projector consists of
an optic system, a light source and displays,
which contain the original images. Projectors
were initially used for showing films but now
they are used on a large scale for displaying
presentations in business organizations and for
viewing movies at home. Fig. 1.12 A portable projector
12 Programming for Problem Solving

memory management
The memory unit of a computer is used to store data, instructions for processing data, intermediate results
of processing and the final processed information. The memory units of a computer are classified as primary
and secondary memory. Computers also use a third type of storage location known as the internal process
memory. This memory is placed either inside the CPU or near the CPU (connected through special fast
bus).

Fig. 1.13 Memory unit categories of computer

The primary memory is available in the computer as a built-in unit of the computer. The primary memory is
represented as a set of locations with each location occupying 8 bits. Each bit in the memory is identified by
a unique address. The data is stored in the machine-understandable binary form in these memory locations.
The commonly used primary memories are as follows:
l ROM — ROM represents Read Only Memory that stores data and instructions, even when the
computer is turned off. It is the permanent memory of the computer where the contents cannot be
modified by an end user. ROM is a chip that is inserted into the motherboard. It is generally used to
store the Basic Input/Output system (BIOS), which performs the Power On Self Test (POST).
l RAM — RAM is the read/write memory unit in which the information is retained only as long as there
is a regular power supply. When the power supply is interrupted or switched off, the information stored
in the RAM is lost. RAM is volatile memory that temporarily stores data and applications as long as
they are in use. When the use of data or the application is over, the content in RAM is erased.
l Cache memory — Cache memory is used to store the data and the related application that was last
processed by the CPU. When the processor performs processing, it first searches the cache memory
and then the RAM, for an instruction. The cache memory can be either soldered into the motherboard
or is available as a part of RAM.
Introduction to Computer and Programming 13

Secondary memory represents the external storage devices that are connected to the computer. They
provide a non-volatile memory source used to store information that is not in use currently. A storage
device is either located in the CPU casing of the computer or is connected externally to the computer. The
secondary storage devices can be classified as:
l Magnetic storage device — The magnetic storage devices store information that can be read,
erased and rewritten a number of times. These include floppy disk, hard disk and magnetic tapes.
l Optical storage device — The optical storage devices are secondary storage devices that use laser
beams to read the stored data. These include CD-ROM, rewritable compact disk (CD-RW), digital
video disks with read only memory (DVD-ROM), etc.
l Magneto-optical storage device — The magneto-optical devices are generally used to store
information, such as large programs, files and back-up data. The end user can modify the information
stored in magneto-optical storage devices multiple times. These devices provide higher storage
capacity as they use laser beams and magnets for reading and writing data to the device.

types of computer software


A computer program is basically a set of logical instructions, written in a LO 1.4
computer programming language that tells the computer how to accomplish Classify various computer
a task. The software is therefore an essential interface between the hardware software
and the user (Fig. 1.14).
A computer software performs two distinctive tasks. The first task is to control and coordinate the
hardware components and manage their performances and the second one is to enable the users to
accomplish their required tasks. The software that is used to achieve the first task is known as the system
software and the software that is used to achieve the second task is known as the application software.

Fig. 1.14 Layers of software and their interactions

System software consists of many different programs that manage and support different tasks. Depending
upon the task performed, the system software can be classified into two major groups (Fig. 1.15):
l System management programs used for managing both the hardware and software systems. They
include:
∑ Operating system
14 Programming for Problem Solving

∑ Utility programs
∑ Device drivers
l System development programs are used for developing and executing application software. These
are:
∑ Language translators
∑ Linkers
∑ Debuggers
∑ Editors

Fig. 1.15 Major categories of computer software

Application software includes a variety of programs that are designed to meet the information processing
needs of end users. They can be broadly classified into two groups:
l Standard application programs that are designed for performing common application jobs. Examples
include:
∑ Word processor
∑ Spreadsheet
∑ Database Manager
∑ Desktop Publisher
∑ Web Browser
l Unique application programs that are developed by the users themselves to support their specific
needs. Examples include:
∑ Managing the inventory of a store
∑ Preparing pay-bills of employees in an organization
∑ Reserving seats in trains or airlines

oVerView of operating system


An operating system (OS) is a software that makes the computer hardware LO 1.5
to work. While the hardware provides ‘raw computer power’, the OS is Discuss various operating
responsible for making the computer power useful for the users. OS is the systems
main component of system software and therefore must be loaded and
activated before we can accomplish any other task. The main functions
include:
l Operates CPU of the computer.
l Controls input/output devices that provide the interface between the user and the computer.
Introduction to Computer and Programming 15

Fig. 1.16 The roles of an operating system

l Handles the working of application programs with the hardware and other software systems.
l Manages the storage and retrieval of information using storage devices such as disks.
Based on their capabilities and the types of applications supported, the operating systems can be divided
into the following six major categories:
l Batch operating system — This is the earliest operating system, where only one program is allowed
to run at one time. We cannot modify any data used by the program while it is being run. If an error
is encountered, it means starting the program from scratch all over again. A popular batch operating
system is MS DOS.
l Interactive operating system — This operating system comes after the batch operating system,
where also only one program can run at one time. However, here, modification and entry of data
are allowed while the program is running. An example of an interactive operating system is Multics
(Multiplexed Information and Computing Service).
l Multiuser operating system — A multiuser operating system allows more than one user to use a
computer system either at the same time or at different times. Examples of multiuser operating
systems include Linux and Windows 2000.
l Multi-tasking operating system — A multi-tasking operating system allows more than one program
to run at the same time. Examples of multi-tasking operating systems include Unix and Windows 2000.
l Multithreading operating system — A multithreading operating system allows the running of
different parts of a program at the same time. Examples of multithreading operating system include
UNIX and Linux.
l Real-time operating systems — These operating systems are specially designed and developed for
handling real-time applications or embedded applications. Example include MTOS, Lynx, RTX
l Multiprocessor operating systems — The multiprocessor operating system allows the use of
multiple CPUs in a computer system for executing multiple processes at the same time. Example
include Linux, Unix, Windows 7.
l Embedded operating systems — The embedded operating system is installed on an embedded
computer system, which is primarily used for performing computational tasks in electronic devices.
Example include Palm OS, Windows CE

MS DOS or Microsoft Disk Operating System, which is marketed by Microsoft Corporation and is one of the
most commonly used members of the DOS family of operating systems. MS DOS is a command line user
interface, which was first introduced in 1981 for IBM computers. Although MS DOS, nowadays, is not used
as a stand-alone product, but it comes as an integrated product with the various versions of Windows.
16 Programming for Problem Solving

In MS DOS, unlike Graphical User Interface (GUI)-based operating systems, there is a command line
interface, which is known as MS DOS prompt. Here, we need to type the various commands to perform
the operations in MS DOS operating system. The MS DOS commands can be broadly categorized into the
following three classes:
l Environment command — These commands usually provide information on or affects operating
system environment. Some of these commands are:
∑ CLS: It allows the user to clear the complete content of the screen leaving only the MS-DOS
prompt.
∑ TIME: It allows the user to view and edit the time of the computer.
∑ DATE: It allows the user to view the current date as well as change the date to an alternate date.
∑ VER: It allows us to view the version of the MS-DOS operating system.
l File manipulation command — These commands help in manipulating files, such as copying a file or
deleting a file. Some of these commands include:
∑ COPY: It allows the user to copy one or more files from one specified location to an alternate
location.
∑ DEL: It helps in deleting a file from the computer.
∑ TYPE: It allows the user to view the contents of a file in the command prompt.
∑ DIR: It allows the user to view the files available in the current and/or parent directories.
l Utilities — These are special commands that perform various useful functions, such as formatting a
diskette or invoking the text editor in the command prompt. Some of these commands include:
∑ FORMAT: It allows the user to erase all the content from a computer diskette or a fixed drive.
∑ EDIT: It allows the user to view a computer file in the command prompt, create and modify the
computer files.

Windows Architecture
The architecture of Windows operating system comprises a modular structure that is compatible with a
variety of hardware platforms. Figure 1.17 shows the architecture of Windows 2000; the later releases of
Windows operating systems are based on similar architecture.
At a high level, the architecture is divided into three layers, viz.
l User mode: Comprises application and I/O specific software components
l Kernel mode: Has complete access to system resources and hardware
l Hardware: Comprises underlying hardware platform
User Mode
The various subsystems in the user mode are divided into the following two categories:
l Environment subsystems: Comprise subsystems that run applications written for other operating
systems. These subsystems cannot directly request hardware access; instead such requests are
processed by virtual memory manager present in the kernel mode. The three main environment
subsystems include Win32, OS/2 and POSIX. Each of these subsystems possess dynamic link
libraries for converting user application calls to Windows calls.
l Integral subsystems: Takes care of the operating system specific functions on behalf of the
environment subsystems. The various integral subsystems include workstation service, server service
and security.
Visit https://ebookluna.com
now to explore a diverse
collection of ebooks available
in formats like PDF, EPUB, and
MOBI, compatible with all
devices. Don’t miss the chance
to enjoy exciting offers and
quickly download high-quality
materials in just a few simple
steps!
Other documents randomly have
different content
several traps. These air-pipes must always have a continuous slope,
to avoid collecting water by condensation.
35. Traps of fixtures near the fresh-air inlet may be ventilated by
being connected with it.
36. No trap vent-pipe shall be used as a waste or soil pipe.
37. Overflow-pipes from fixtures must, in each case, be connected
on the inlet side of the trap.
38. Every safe under a wash-basin, bath, urinal, water-closet, or
other fixture, must be drained by a special pipe not directly
connected with any soil-pipe, waste-pipe, drain, or sewer, but
discharging into an open sink, upon the cellar-floor, or outside the
house.
39. The waste-pipe from a refrigerator shall not be directly
connected with the soil or waste pipe, or with the drain or sewer, or
discharge into the soil; it should discharge into an open sink. Such
waste-pipes should be so arranged as to admit of frequent flushing,
and should be as short as possible, and disconnected from the
refrigerator.
40. The sediment-pipe from kitchen boilers must be connected on
the inlet side of the sink-trap.
41. All water-closets within the house must be supplied with water
from special tanks or cisterns, the water of which is not used for any
other purpose. The closets must never be supplied directly from the
Croton supply-pipes. A group of closets may be supplied from one
tank; but water-closets on different floors are not permitted to be
flushed from one tank.
42. The valves of cisterns must be so fitted and adjusted as to
prevent wasting of water, especially where cisterns are supplied from
a tank on the roof.
43. The overflow-pipes from water-closet cisterns must discharge
into an open sink, or where its discharge will attract attention and
indicate that waste of water is occurring, but not into the bowl of the
water-closet, not into the soil or waste pipe, nor into the drain or
sewer. When the pressure of the Croton is not sufficient to supply
these tanks, a pump must be provided.
44. Tanks for drinking-water are objectionable; if indispensable,
they must never be lined with lead, galvanized iron, or zinc. They
should be constructed of iron, or wood lined with tinned and
planished copper. The overflow should discharge upon the roof, or
be trapped and discharge into an open sink, never into any soil or
waste pipe or water-closet trap, nor into the drain or sewer.
45. Rain-water leaders must never be used as soil, waste, or vent
pipes; nor shall any soil, waste, or vent pipe be used as a leader.
46. When within the house, the leader must be of cast-iron, with
leaded joints; when outside of the house, and connected with the
house-drain, it must be trapped beneath the ground or just inside of
the wall, the trap being arranged in either case so as to prevent
freezing. In every case where a leader opens near a window or a
light-shaft, it must be properly trapped at its base.
47. No steam exhaust or blow-off pipe from a steam-boiler will be
allowed to connect with any soil or waste pipe, or directly with the
house-drain. They should discharge into a tank or condenser, the
waste from which, if to be discharged into the sewer through the
house-drain, must be connected on the sewer side of the running
trap.
48. Subsoil drains must be provided whenever necessary.
49. Yards and areas should always be properly graded, cemented,
flagged, or well paved, and properly drained; when the drain is
connected with the house-drain, it must be effectively trapped.
Front-area drains must, where practicable, be connected with the
house-drain inside of the running trap.
50. Cellar and foundation walls must, where possible, be rendered
impervious to dampness, and the use of asphaltum or coal-tar pitch,
in addition to hydraulic cement, is recommended for that purpose.
51. No privy-vault or school-sink will be allowed in any cellar or
basement; nor shall the general privy accommodation of a tenement
or lodging house be allowed to be in the cellar or basement.
52. No privy-vault, or cesspool for sewage, will be permitted in any
part of the city where water-closets or a school-sink can be
connected with a public sewer in the street.
53. School-sinks must be of cast-iron, not more than two feet in
depth, connected at the upper end with the Croton supply, and at
the lower end with a drain leading to the street-sewer, and provided
with an outlet at the lowest point and on the bottom so as to admit
of a complete discharge of the contents whenever the outlet is
opened and the sink flushed with water.
54. The sink must be set so that the flange will be at least two
feet below the yard surface, to prevent freezing. It must be at least
ten feet from any window, or as near that distance as practicable.
55. The waste-pipe from a hydrant-sink in the yard must be
properly trapped, especially where it discharges into a school-sink, a
privy-vault, or cesspool, or the house-drain.
56. Open light and air courts must be properly drained.
57. When a privy-vault or cesspool must necessarily be used, and
the water-supply of the premises is from a well, they must be at
least fifty feet from the well; and the privy-vault must be absolutely
tight.
Explanatory Remarks.
2. As direct as possible. To insure an uninterrupted flow. When
a pipe has to pass an obstruction (a beam or post) an offset is used
(Fig. 2).
3. The soil-pipe is that which conveys the contents of water-
closets to the house-drain: the waste-pipes are intended to carry
other refuse fluids only. The house-drain is the large pipe which
receives the contents of the soil and waste pipes and conveys them
outside the house.
A trap is a bend (with or without an enlargement) of the pipe,
intended to retain a sufficient amount of the fluids that enter it to
occlude the pipe and prevent the backward flow of air. The effective
water-seal is represented by the total depth of water in the trap,
minus the inside diameter of the pipe, and should be at least one
inch.

Fig. 2.—Offset. Fig. 3.—S-trap. Fig. 4.—Half S-trap.

Traps are of various kinds, and many are patented. The


accompanying figures represent the principal types.

Fig. 5.—D-trap. Fig. 6.—Bag-trap.

Fig. 3 is the S-trap. Fig. 4 is the half S-trap. There is also a three-
quarter S-trap. Fig. 5 is a D-trap, formerly much used, but now
mostly out of date, because it retains dirt. Fig. 6 is a bag-trap. It
has no advantage over the S-trap, and uses more material. Fig. 7 is
a bottle-trap, much used in Boston. This also retains dirt. There are
varieties of it, the distinguishing feature of all being that the fluids
enter them at the bottom and flow out at the top.

Fig. 7.—Bottle-trap. Fig. 8.—Bell-trap.

Fig. 9.—Running-trap. Fig. 10.—Mason’s trap.

Fig. 8 is the bell-trap, so called from its shape. Much used for the
drains of paved areas, yards, and cellars; liable to retain dirt, and
needs frequent cleaning; not a good trap. Fig. 9 is a running-trap,
used in house-drains and other pipes that are nearly horizontal. Fig.
10 represents a mason’s trap. Is built of brick or stone and cement.
Used in brick-drains and sewers, in receiving-basins at street
corners, etc. Requires frequent cleaning, and should never be used
inside a building. Fig. 11 represents the method of trapping a
cesspool. The same plan is also used for grease-traps, the outlet-
pipe dipping below the surface of the contents so that it is never
obstructed by the grease, which floats on top.

Fig. 11.—Trapped cesspool.

A few patent traps are shown as samples:

Fig. 12.—Adee trap. Fig. 13.—Bower trap.


Fig. 12 is the Adee trap, a modification of the D-trap. Fig. 13 is the
Bower trap, claimed to be secured against siphonage or back
pressure by a rubber ball which floats up against the entering-pipe.
Modification of the bottle-trap. Fig. 14 is Bedell’s trap, with a metallic
flap or valve, and an opening on the sewer side of the valve, to
relieve pressure. Fig. 15 is Stewart’s trap, intelligible from the
diagram. Traps are also made of iron or glass, with a mercury seal,
which, it is claimed, are proof against siphoning, pressure, or
evaporation.

Fig. 14.—Bedell’s trap. Fig. 15.—Stewart’s trap.

4. A louvered sky-light is one with slats at the sides inclining


outward, so that air can escape but rain can not enter.
6. Calked with lead. (See 26.)
7. Tempered-up cement. Cement which has been used once,
and has been broken up and ground, for using a second time.
9. House-drain, of iron. (See “Bad Odors, 2, a.”)
10. Water-closets. Four principal classes, with innumerable
varieties, mostly patented.
1. The pan-closet (Fig. 16). Its chief advantage is its cheapness
and the ease with which it can be repaired. Its disadvantage is the
odor that usually attends its use. When the handle (a) is raised, the
contents of the pan (b) are thrown against the side of the iron
container (c), and some filth adheres there and decomposes, filling
the container with a noisome stench, which escapes into the room
every time the closet is used. An abundant flush, an enameled
container, and proper ventilation of the container, reduce this
nuisance materially. Generally condemned by sanitarians.

Fig. 16.—Pan-closet. Fig. 17.—Hopper-closet.

2. Hopper-closets (Fig. 17). Rather unsightly, because the water


and floating matter in the trap are visible, and matters often cling to
the sides, but, with an abundant flush suddenly discharged, are very
inoffensive.
3. Plunger-closets, of which the Jennings closet (Fig. 18) may
be taken as a type. The handle lifts a plug, which allows the
contents of the bowl to run out, and, when the plug is dropped in
place, the bowl is filled again from a ball-cock. These closets are
liable to get out of order; the plungers or plugs lose their rubber
flanges and leak, and the plunger-chamber is apt to retain filth.
Fig. 18.—Jennings closet.

4. It is evident that if the hopper-closet could have its trap bent to


one side out of sight, and its hopper enlarged toward the bottom, so
that nothing would strike and cling to its sides, it would be an
excellent one. Of such a type are the Tidal-Wave and National
closets (Fig. 19), a being the water-pipe, which discharges into a
flushing rim, and b a vent-pipe to relieve pressure between the two
bodies of water during a discharge, and prevent siphoning.
Fig. 19.—Tidal-wave closet. Fig. 20.—Y-branch. Fig. 21.—Quarter bend.

A water-closet, to be well flushed, should have a discharge of


three gallons of water in five seconds, sent directly downward all
around the rim.
School-sink (also called trough-sink or privy-sink). An iron
trough, having a sewer-connected opening with a movable iron plug
in the bottom at one end, for the discharge of its contents, and a
pipe at the other end, from which it is filled with water. It is
practically an elongated water-closet. (See 53.)
12. Y-branch (Fig. 20), so named from its shape. There are also
half Y-branches.
Eighth bends. There are also quarter bends (Fig. 21), sixth
bends, and sixteenth bends. These are used in pipe-connections in
order to discharge the contents of the branch pipes in the same
general direction with the current in the main pipes, for, if the
discharge enters at a right angle, a deposit is apt to form opposite
the point of connection.
14. Trap in house-drain. Intended to cut off all communication
between the house and the street sewer. If a contagious disease
occurs in one’s own house, he can be sure that the excreta are
disinfected, and that disease-germs can not escape into the air, even
if the pipes happen to be defective; but he can not be sure that such
excreta are properly disinfected in other houses. The only safe way,
therefore, is for each house to be cut off from all others by the
means described. The objections to the trap on the house-drain are,
that it forms a slight obstruction to the flow of drainage, and is liable
to be obstructed by deposits, and that it favors “cushioning,” i. e., the
forcing of smaller traps, when the air in the drain is compressed
between this trap and a down-coming mass of water. (See “Bad
Odors,” 1, d.) The first of these objections is met by making the trap
a half S one, so that the fluids fall down one limb with sufficient
force to wash out the bottom of the trap thoroughly with each
discharge, and the second by the fresh-air inlet, which relieves the
pressure that otherwise might force the traps.
15. The fresh-air inlet affords free entrance for air, and, as the
main lines of pipe are open above the roof, the difference in length
of the pipes will give rise to a constant current of fresh air through
them, in one direction or the other. (See “Bad Odors,” 1 c.) This
results in the oxidation of whatever filth may cling to the pipes, and
dilutes offensive gases so that they are rendered harmless. It has
also been shown that the various microscopic organisms, which are
believed to be the specific cause of certain diseases, increase in
virulence, when they propagate in the absence or with a deficient
supply of oxygen, while the intensity of their action is diminished if
they grow where oxygen is plentiful.
16. Ventilation in chimney-flues. (See “Bad Odors,” 1, c.)
17. Vertical pipes of iron. Iron resists corrosion and the assaults
of rats better than lead, and lead pipes are sometimes occluded by
pressure and settling. Branch wastes are generally of lead because it
is easily cut and bent, so as to be used in difficult situations.
Return-bend or cowl. To prevent senseless persons from
throwing things down the pipe, and thus obstructing it.
20. Diameter of pipes. The inside diameter is always meant.
21. D-pipe. (See Appendix B.)
22. No traps on vertical pipes,i. e., at the foot of such pipes,
because they would prevent the free circulation of air, and thus
render the fresh-air inlet practically useless. Also to prevent
“cushioning.”
23. Cast-iron pipes are made in five-foot lengths, with an
enlargement at one end, called the hub or bell, and a bead around
the edge of the other end (the spigot-end). The spigot-end of one
pipe fits loosely into the hub of another, sufficient room being left for
calking. (See 26.)
24. Pipes are tarred by being heated to 500° Fahr. and then
dipped perpendicularly into a hot bath of coal-tar pitch mixed with a
small proportion of heavy coal-oil. This coating prevents corrosion,
or at least greatly retards it.
25. Wrought-iron pipes, with screw joints, are used by the
Durham House Drainage Company, the joints being gas-tight. They
have the advantage of being very durable and impervious to gases,
but the disadvantage of being too permanent. If it is desired to
change the position of a fixture, or to connect a new one, it is easy
to break a hole in a cast-iron pipe, or to remove a portion of it, but
where wrought-iron pipe is used this is almost impossible. The
Durham system also costs about twenty-five per cent more than the
common one, and it is not strictly correct to say that its use renders
a house absolutely secure against leakage of sewer-air, because it
does not do away with lead branch-pipes, in which frequent
leakages occur, and all irregular portions of pipe, with branches, etc.,
in this system are made of cast-iron with calked joints, as in the
ordinary system.
The water-test is applied by plugging the pipe carefully, and
closing all openings below a certain point, and then filling it with
water to that level. If there is any leakage, the water-level will
gradually sink. If the pipes are tight, it will remain the same.
Peppermint-test. (See hereafter.)
26. Oakum is packed into the space between the spigot-end of
one pipe and the hub of the other, and driven against the bead
above mentioned. This packing is called a gasket. Melted lead is
poured in on top of the oakum, and, when it has cooled, is driven in
tight with a calking iron and mallet. When ordinary pipe is used, the
calking will sometimes split the hub, and this furnishes an argument
for the general use of extra-heavy pipe.
Iron-filings, etc., making what is called a rust-joint.
27. Ferrules, or sleeves, are used because lead pipes are too
soft and yielding to withstand the calking. Lead can not be soldered
to iron, and therefore brass or copper has to be used. If iron ferrules
are used, the lead pipe must be turned up on the outside far enough
so that its edge shall be covered by the melted lead used in calking,
so as to prevent leakage of gas, as hereafter described. (See “Bad
Odors,” 1, b.)
28. Wiped-joints are those always used for lead pipe, and are
indicated by a raised ring of solder surrounding the pipe.
29. A trap, with a good water-seal, is an effective barrier against
the passage of sewer-air or particles of organic matter. The
experiments of Carmichael, confirmed by Wernich and Pumpelly,
have amply demonstrated that sewer-air passes through the water-
seal in such minute quantities that it can not possibly harm any one,
and that solid particles of matter can not pass at all.
Separate traps, except, etc. (See “Bad Odors,” 1, d.)
33. Siphonage. (See “Bad Odors,” 1, d 37.)
37. Overflow-pipes from fixtures. It is better to connect them
with the trap below the water-level. (See “Bad Odors,” 1, d.)
38. Safes are sheets of metal (generally lead) with turned-up
edges, placed beneath basins, sinks, water-closets, etc., to protect
the floor in case of leakage. The waste-pipes of safes are common
sources of nuisance. (See “Bad Odors,” 1, c.)
39. To prevent contamination of the contents of the refrigerator.
41. When water-closets are flushed directly from the common
supply-pipe of the house, as in the different kinds of valve-closets,
the water in the pipes, under certain circumstances, will be
contaminated: e. g., if a person opens a faucet on one floor at the
same moment that the valve is opened to flush a water-closet on a
higher floor, water will be sucked back from the valve, and the air of
the closet will follow it. Check-valves have been used to prevent this,
but they should not be depended on.

Fig. 22.
Fig. 23.
Fig. 24.

Various forms of tanks or cisterns for water-closets are here


shown. Fig. 22 represents a tank, b, which discharges water as long
as the handle (attached to the chain a) is raised. It gives a flush also
of the entire contents of the service-box c, after the handle is
lowered. Fig. 23 shows a waste-preventing tank, which is divided
into two compartments, b and d. It will be seen that this allows only
the contents of d to be discharged, with an after-flush from c. Fig.
24 shows a tank, in which the chain a is attached to the seat, and is
pulled down when the seat is depressed. It will be seen that no
water can flow while the closet is in use, but, when the seat is
released, the contents of c are discharged with great force. In all
these figures, e is a ball-cock. This cock is controlled by a hollow
copper ball, which floats on water, and is attached to the end of a
lever. When the water falls, the ball falls with it, and opens the cock.
When it is floated up to a certain point, it closes the cock and stops
the flow.

Fig. 25.—Drainage plan for dwellings.

45. Leaders should not be used as soil-pipes, because, during a


rain, the ventilation of the pipes is interfered with by the downward
flow of water, which will also empty unventilated traps by siphoning.
The necessity of having leaders open flush with the roof also
interferes with proper ventilation.
47. If steam enters a soil-pipe, it heats the water in the traps,
injures joints on account of the extreme changes of temperature
induced, and hastens corrosion of the pipes.
Fig. 25 shows a system of house-drainage for a city house
planned in accordance with the above rules.

Fig. 26.—Field’s flush-tank.

In country houses, where there are no sewers, the best method


of disposing of the house-slops is subsoil drainage. The house
system may be the same as that already explained for city houses.
The fluids are conducted by a pipe with tight joints to a flush-tank
(Fig. 26) near the house. This tank is so constructed that it empties
itself, by a siphon action, whenever it gets full, discharging all its
contents in a very short time, and thus washing out thoroughly the
pipes into which it empties. “The outlet-pipe from this tank is
continued by a cemented vitrified pipe to a point about twenty-five
feet farther away. Here it connects with a system of open-jointed
drain-tiles, consisting of one main, fifty feet long, and ten lateral
drains, six feet apart, and each about twenty feet long. These drains
underlie a part of the lawn, and are only about ten inches below the
surface” (Waring). It will be understood that the purpose of this
method of drainage is to have the organic matter contained in the
house-refuse appropriated by vegetation, and it must therefore be
distributed within reach of the grass-roots.
If water-closets are used, the following system is recommended in
“The Sanitary Engineer”: Collect all the sewage of the house in a
small and perfectly tight tank or cesspool, in which the paper and
fecal matter soon become macerated by fermentation and reduced
to a pulp. This tank should overflow into the flush-tank, the
overflow-pipe dipping at least a foot below the point of discharge, to
avoid the scum. The siphon of the flush-tank should be accessible by
a man-hole, so as to be readily cleaned. If thus arranged, and if no
roots of trees are in the soil, the distribution-pipes will not clog for a
year or more, sometimes not for ten years.
Pipes should be laid at a depth of eight inches, with a slight and
uniform descent of not over six or eight inches in one hundred feet.
Branches from a four-inch main to the two-inch distribution-pipes
should lead from the bottom of the former, instead of from the side,
as in ordinary drain connections.
There should be a grease-trap (see “Explanatory Remarks,” 3)
attached to the kitchen waste-pipes, in order to prevent clogging of
the tanks and pipes by the congelation of fat.
Bad Odors.
When bad odors in a house are traceable to the drainage,
they will usually be found to be due to one or more of the
following causes:
1. To faulty construction. (a.) Drains.—These may be made of
brick or stone and cement. Such materials are pervious to gases,
even when sound, and are peculiarly liable to be channeled by rats,
especially where an iron or lead pipe enters them. Such a drain
should be replaced by an iron one.
(b.) Joints.—Cement-joints are pervious to
gases. Putty-joints crack and so become
pervious. A lead pipe is sometimes connected
with an iron one by means of an iron ferrule, the
lead pipe passing inside the ferrule and being
turned over its lower edge, extending up on the
outside, the ferrule then being calked into the
hub. When paper is used for the gasket or
packing, it rots away in time, and a passage is
left through which gas can escape as follows: up Fig. 27.—Iron
between the hub and the turned-over lead pipe, ferrule improperly
calked.
over its edge, between it and the calking, down
between the lead pipe and the ferrule, across the
lower edge of the ferrule, and out between the inner surface of the
ferrule and the outer surface of the lead pipe. (See Fig. 27.)
Sometimes a connection of lead with iron is made by means of a
lead flange fastened around the iron pipe with wire, and
sometimes the lead pipe is simply stuck into a hole in the iron pipe
and fastened with cement or putty. Such work should be replaced by
properly made joints as described in the above regulations. (Or in
“Bad Odors,” 2, c.)
(c.) Pipes.—If the leaders are not trapped at the bottom,
offensive gases from them may enter the nearest windows. A leader
is never of the same length as the soil-pipe, and, if there is direct
communication between them through the house-drain, there will
always be a current of air through them in one direction or the other.
If the external air is colder than that inside the pipes, then the
heavier column of air will be over the shorter pipe, and the current
will be down that one and up the other. If the external air is warmer
than that in the pipes, the heavier column will be that which includes
the longer pipe, and the current will be down that one and up the
shorter. So, as a rule, the current in winter is down the short pipe
and up the long one, while in summer it is reversed, and, as the
short pipe often ends near windows, the nuisance is greatest when
these windows are open. Of course, in such cases, the leader must
be trapped.
Ventilating-pipes sometimes end in chimney-flues. This is a bad
plan, for, if the flue is in use, the open end of the pipe will become
choked with soot and finally be rendered useless. If the flue is not
used, there will often be a down draught in it, and the offensive
gases may be conveyed through stove-pipes or fireplaces into the
rooms of the house. Such gases may even penetrate the walls of the
flue and so enter the house. If such a pipe is ever run into a flue, it
should be extended at least two feet above the chimney-top.
Ventilating-pipes are sometimes badly arranged, so that they
actually neutralize a trap and render it useless. (See Fig. 28.) In this
figure a is the soil-pipe and b the ventilating-pipe.
Fig. 28.—Faulty arrangement of ventilating pipes.

Safe-wastes and the overflow-pipes of tanks and cisterns may


be connected with the soil or waste pipe. When they are, they are
usually trapped. It will often be found that the traps are empty and
useless, so that offensive gases escape from the pipes. With tank-
overflow pipes this is generally the case. Safe-waste traps are
sometimes provided with small feed-pipes, intended to discharge
water into them every time the fixtures are used. It will often be
found, however, if the end of the feed-pipe is pulled up out of the
waste, that no water runs through it, and it is useless, sometimes
because it is too small and is choked with dust and sediment, and
sometimes because it is wrongly attached to the source of supply.
Safe-wastes, discharging into the kitchen or cellar, may convey to
the rooms odors of cooking or of articles stored in the cellar (onions,
turnips, etc.), or from the servants’ water-closet, which is often
offensive. If urine or other offensive liquids from leakage flow
through them, the upward currents of air will be impregnated with
odors from the filth that has clung to the pipe long after the leak has
been repaired. In any event these safe-wastes constitute a direct
communication between different rooms of a house, which is not
always desirable. It is better to do without them. They are rarely of
any use. If required, however, they should either be trapped under
the safe, and means taken to insure a constant water-seal, or they
may be closed by a piece of paper pasted over the lower opening,
which will prevent the entrance of any odors from cellar or kitchen,
but will give way in case of leakage. The safe-wastes of water-
closets often discharge into the trap of the water-closet. This is a
bad plan, because, if there is an obstruction in the trap, the safe-
waste is, of course, useless. If offensive odors are traced to safe-
wastes, the openings had better be sealed. If overflow-pipes are the
source, they must be disconnected from the soil or waste pipe and
made to discharge elsewhere (e. g., into some sink or water-closet).

Fig. 29.—Cushioning illustrated.


(d.) Traps.—If two traps are so arranged that the air is
compressed between them by an oncoming rush of water, the trap
containing the shallowest water-seal will be forced, and a certain
amount of air will escape through it from the interior of the pipe.
This result is due to “cushioning,” as it is called, and is illustrated in
Fig. 29. Such a fault is to be remedied by connecting the crown of
one of the traps with a ventilating-pipe, so that any pressure of the
kind is immediately relieved without disturbing the seal of the trap.

Fig. 30.—Double-trapped waste-pipe (air-bound). Fig. 31.—Two


sinks with but one trap.

If there are two traps on the same line of pipe (Fig. 30), so that a
part of the interior of the pipe is cut off from the external air in both
directions, it becomes “air-bound,” and one of two results will follow,
viz.: water discharged into the fixture above the higher trap will
remain in the bowl and not run down, on account of the
compression of air between the traps; or, if it does run out of the
fixture, it will displace an equivalent bulk of foul air, which will
bubble up through the upper trap and cause offensive odors. In such
a case, the lower trap should be removed.
If two or more waste-pipes (as in sets of tubs, in sinks, and
often in urinals) are provided with but one trap for all (Fig. 31),
there will be a constant current of air along the pipes, sometimes
emerging from one opening and sometimes from another. This air
will be contaminated by the filth that lines the pipes, and will often
be quite offensive. In such cases, each waste-pipe should be
independently trapped, or (as in the case of bath-tubs or urinals) the
overflow-pipe should be connected with the trap of the waste-pipe
below the water-seal, as in Fig. 25.
When a body of water sufficiently large to nearly fill a pipe is
discharged into it, it drags air along with it, and exhausts the air in
all branch-pipes to a greater or less extent. When this exhaustion
amounts to a diminution of the pressure in the pipe of about 1/350,
the water in an ordinary trap (with a one-inch seal) will be forced
out of it by the pressure of the external atmosphere, or in other
words will be sucked out of the trap into the pipe, leaving no water-
seal in the trap, and, therefore, allowing free exit for sewer-air. This
effect is known as the “siphoning” of the trap, and is most likely to
occur when the main pipe is not open at its upper extremity (is not
ventilated), and when the branch wastes are of the same size with
the main one. This fault is remedied by the ventilation of the traps,
and of the main pipes, as described in the regulations above quoted
(17 and 33).
2. To defects in the pipes. (a.) Drains.—Bad odors in cellars
often come from broken earthenware or tile drains, cracked by
settling, or from rat-holes in cemented drains. Earthenware or brick
drains inside a house should be replaced by iron ones.
(b.) Joints.—Cement or putty joints are often cracked. Water-
closets sometimes become loosened from the floor and leak fluids
and gases. The covers of hand-holes of traps sometimes get loose
and leak gas. Sometimes trap-screws, instead of being at the
bottom of the trap, where they are covered by water, are at the top;
if these are loose, gases may escape. All such defects should be
repaired.
(c.) Pipes.—Both lead and iron pipes are corroded and in time
perforated by sewer-air. Such corrosion is most likely to occur at
points where gases come in contact with a dry part of the pipe, viz.,
at the crowns or domes of traps, and in ventilating-pipes. For this
reason, ventilating-pipes should never be made of thin iron
(galvanized iron), and should always be protected by a tar-coating.
The crowns of lead traps (especially of water-closets) are often
bitten into by rats in search of water. In all cases when the crown of
a trap is perforated, there is rarely any leakage of fluid to indicate it,
but offensive gases escape. All corroded traps and pipes should be
replaced by new ones, and not patched up. Holes in iron pipes may
be closed by iron bands surrounding the pipe, and fastened with
red-lead putty and screw-bolts (Fig. 32). A new joint may be made
by means of a saddle-hub (Fig. 33) carefully secured in a similar
manner. Lead pipes are sometimes protected against rats by being
encircled by tin, or packed in pounded glass.
3. To carelessness. (a.)
Evaporation.—If fixtures are
not in constant use, the
water soon evaporates from
Fig. 32.—Bands. the traps and gives exit to Fig. 33.—Saddle-
sewer-air. This often happens hub.
in warm weather, and when a house is vacant for
a time. To prevent evaporation, a little oil may be poured into the
trap, to protect the surface of the water-seal, or it may be made the
special duty of a servant to keep the traps full of water when the
fixtures are not in use.
(b.) Dirt.—The inside of a pipe often becomes coated with slime,
consisting largely of grease, especially in kitchens. This filthy lining
rapidly decomposes, and that portion above the trap may give out
bad odors. The pipes may be cleansed with a strong hot solution of
soda.
Examination of House-Drainage.
If the object of an examination is to determine whether the
drainage is planned and constructed in accordance with the best
methods of the day, each point referred to in the above regulations
should be carefully investigated.
If the object is to determine the source of offensive odors, or if
there has been sickness in the house of such a character as to
indicate possible defects in the plumbing, the several sources of bad
odors just enumerated should each be carefully inquired into. A few
additional suggestions as to the method of examination will not be
out of place.
It will be found much easier to determine the direction, number,
and situation of the main lines of pipe, if the examination is begun at
the roof and continued downward. If a beginning is made in the
cellar, confusion results.
“Cushioning” is determined by causing the discharge of a
considerable mass of water (as from a bath-tub or water-closet) into
the main pipe, at some distance above the suspected fixture. If
there is a regurgitation in the fixture under observation, there is
certainly an obstruction in the pipe at some point below the fixture.
If the obstruction is caused by something lodged in the pipe, the
back-flow in the fixture will be a steady one, because there will be
some leakage through the obstruction, while if it is due to
compressed air, which is elastic, the regurgitation will be by spurts,
and the water in the trap may even be thrown up to a considerable
height.
“Siphoning” is also determined by filling the pipe with water in
the manner just explained. If the trap of the fixture under
observation is emptied by siphoning, a sucking or gurgling noise will
be heard in it, and a flame held over the outlet of the fixture will be
drawn downward by the inward current of air.
One trap to several pipes (when it is suspected but not
certainly known because the trap is out of sight) may be detected by
the fact that there will always be a current of air in one direction or
the other through such pipes, and more or less odor will escape. If
the back of the hand is wet, it becomes very sensitive to such a
current, and by holding alternately the palm and the back of the
hand, or even of the forefinger (wet), over an opening, the existence
and direction of such a current can be easily determined. If the
odors are from such a source, it can then be made evident by
covering all the outlets but one with wet paper, so as to prevent the
air-currents, when the odors will temporarily disappear.
If a trap is accessible, it is easy to determine whether its water-
seal is preserved or not by tapping it from top to bottom with some
metallic substance, when the difference in sound will indicate the
exact level of the water inside.
Those parts of the plumbing which are not accessible to inspection
must be examined by introducing into the pipes some strong-
smelling substance, which will indicate defects by its escape through
them into the house. Oil of peppermint is often used for this
purpose.
The Peppermint-Test.
For testing the pipes of an ordinary dwelling, one ounce of the oil
of peppermint is sufficient. For a large building more may be
needed. The drug costs from twenty-five to seventy-five cents an
ounce, according to its quality and the place where it is bought.
It is best to introduce the oil into the pipes from outside the
house, if possible, so that the odor which inevitably attends the
process may be dissipated in the external air. The object being to
ascertain the location of defects in the pipes inside the house, the
examiner must feel certain, if he detects the odor of peppermint
anywhere, that the vapor has come to him from inside the pipes,
and not from the outside. If the ventilating-pipes are so constructed
that the oil can not be poured in from the roof, then it must be
poured into some basin or water-closet in the upper portion of the
house. The peppermint should first be mingled with a pailful of hot
water to promote rapid volatilization, and poured slowly down the
pipe. After it is poured down, the openings at the upper extremities
of the pipes should be closed, so that the pressure of the vapor
inside the pipes may not be relieved in that direction. If the odor of
peppermint, thus introduced with the precautions mentioned below,
is perceived anywhere in the house, it is an indication that there is
an opening in some pipe, through which sewer-air may escape. This
opening may be a defect, or it may be due to siphoning of traps, or
to faults of original construction. There will not usually be much
difficulty in locating it with considerable exactness.
Special Precautions.
The peppermint should be kept on the roof, or on a window-sill
outside the house, until needed, for it is so volatile that the vapor
escapes through the cork, and if the odor gets into the house in this
way, it will vitiate the examination.
The person who pours the peppermint should remain on the roof
or in the room where he does it, with the doors closed, until the
examination is complete, for the odor will cling to his clothing and
follow him wherever he goes for an hour or more.
Additional Remarks.
If bad odors have been noticed, and no defect can be found in the
ways above mentioned, they may be due to decaying animal matter
(dead rats, etc.), or (in the city) to defects in the plumbing of the
adjoining house, offensive gases from which may penetrate the wall.
The source of bad odors need not necessarily be in the immediate
vicinity of the place where they are noticed, for the walls of buildings
are full of channels and openings, through which offensive gases
may be carried by currents of air, so as to emerge at a considerable
distance from their origin. Thus, in winter, they are apt to be most
noticeable near a fire.
SUMMARY OF THE BEST METHODS OF DRAINAGE.
For houses where there are public sewers: water-carriage.
For country houses, if isolated from sewers, and where
expense is no objection: water-carriage with subsoil drainage.
In villages and small towns, without sewers: subsoil drainage
(for slops), and pails (for excreta), frequently removed by proper
officers.
For farm-houses: subsoil drainage for slops, and a movable tank,
with dry earth disinfection, for excreta.
For sea-side houses, isolated: if there is vegetation, subsoil
drainage for slops, and earth-closets.
For sea-side villages: subsoil drainage and the pail system.
For sea-side houses, where there is no vegetation: for
excreta, earth-closets or a movable iron tank, with dry-earth
disinfection; for slops, a water-tight cesspool, with arrangements for
emptying its contents into the sea when the tide is ebbing.
How to prevent contamination of the air from the ground.
Have the house separated from the soil on which it is built by a
layer of asphalt between two layers of cement, extending over the
whole cellar-floor, through the foundation-walls and up above the
point where the ground touches the walls outside. Or have the
house built without a cellar, and with perforated underpinning, so as
to allow a free circulation of air underneath it. The subsoil should
also be drained by tiles laid at least a foot lower than the cellar-
bottom.
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!

ebookluna.com

You might also like