Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
43 views

[FREE PDF sample] Problem Solving and Python Programming E. Balagurusamy ebooks

Balagurusamy

Uploaded by

kunerlafonnl
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
0% found this document useful (0 votes)
43 views

[FREE PDF sample] Problem Solving and Python Programming E. Balagurusamy ebooks

Balagurusamy

Uploaded by

kunerlafonnl
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/ 41

Download the Full Version of ebook for Fast Typing at ebookmass.

com

Problem Solving and Python Programming E.


Balagurusamy

https://ebookmass.com/product/problem-solving-and-python-
programming-e-balagurusamy/

OR CLICK BUTTON

DOWNLOAD NOW

Download More ebook Instantly Today - Get Yours Now at ebookmass.com


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

Programming for Problem Solving E Balagurusamy

https://ebookmass.com/product/programming-for-problem-solving-e-
balagurusamy/

ebookmass.com

Programming and Problem Solving with Python Ashok Namdev


Kamthane

https://ebookmass.com/product/programming-and-problem-solving-with-
python-ashok-namdev-kamthane/

ebookmass.com

Python Programming: Using Problem Solving Approach 1st


Edition Reema Thareja

https://ebookmass.com/product/python-programming-using-problem-
solving-approach-1st-edition-reema-thareja/

ebookmass.com

Computer Programming E. Balagurusamy

https://ebookmass.com/product/computer-programming-e-balagurusamy/

ebookmass.com
Programming in C E. Balagurusamy

https://ebookmass.com/product/programming-in-c-e-balagurusamy/

ebookmass.com

Introduction To Computing And Problem Solving Using Python


1st Edition E. Balaguruswamy

https://ebookmass.com/product/introduction-to-computing-and-problem-
solving-using-python-1st-edition-e-balaguruswamy/

ebookmass.com

Programming in ANSI C 6th Edition E. Balagurusamy

https://ebookmass.com/product/programming-in-ansi-c-6th-edition-e-
balagurusamy/

ebookmass.com

MATLAB: A Practical Introduction to Programming and


Problem Solving 4th Edition Stormy Attaway

https://ebookmass.com/product/matlab-a-practical-introduction-to-
programming-and-problem-solving-4th-edition-stormy-attaway/

ebookmass.com

Introduction to Programming with Java: A Problem Solving


Approach 3rd Edition John Dean

https://ebookmass.com/product/introduction-to-programming-with-java-a-
problem-solving-approach-3rd-edition-john-dean/

ebookmass.com
Problem Solving and
Python Programming
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, Tamil Nadu. 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, Uttarakhand. 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. His best-selling
books, among others include:
● Programming in ANSIC, 7/e

● Fundamentals of Computers

● Computing Fundamentals and C Programming, 2e

● Programming in C#, 3/e

● Programming in Java, 5/e

● Object-Oriented Programming with C++, 7/e

● Programming in BASIC, 3/e

● Numerical Methods

● Reliability Engineering

● Problem Solving and Python Programming


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.
Problem Solving and
Python Programming

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 Naicker Industrial Estate, Alapakkam, Porur, Chennai - 600 116

Problem Solving and Python Programming

Copyright © 2018 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

1 23456789 D101417 22 21 20 19 18
Printed and bound in India

Print Edition:
ISBN-13: 978-93-87067-01-1
ISBN-10: 93-87067-01-7

Managing Director: Kaushik Bellani

Director—Science & Engineering Portfolio: Vibha Mahajan


Senior Portfolio Manager—Science & Engineering: Hemant K Jha
Associate Portfolio Manager: Mohammad Salman Khurshid

Production Head: Satinder S Baveja


Copy Editor: Taranpreet Kaur
Assistant Manager—Production: Anuj K Shriwastava

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. Apt., Paschim Vihar, New Delhi 110 063 and printed at

Cover Printer:

Visit us at: www.mheducation.co.in


Contents

Preface ix

Unit 1: Introduction to Computing and Algorithmic Problem Solving

Chapter 1 Introduction to Digital Computer 3


1.1 Introduction 3
1.2 Von Neumann Concept 5
1.3 Storage 8
1.4 Programming Languages 12
1.5 Translators 14
1.6 Hardware and Software 15
1.7 Operating Systems 17
Always Remember 18
Key Terms 18
Review Exercises 19
Multiple Choice Questions 19
Short Questions 21
Answers to Multiple Choice Questions 22

Chapter 2 Problem Solving Strategies 23


2.1 Problem Analysis 23
2.2 Algorithms 24
2.3 Flow Charts 26
2.4 Examples of Algorithms and Flow Charts 30
Always Remember 35
Key Terms 35
Review Exercises 36
vi Contents

Multiple Choice Questions 36


Short Questions 37
Answers to Multiple Choice Questions 37

Appendix A: Practice Exercises with Algorithm and Flow Chart 38

Appendix B: Problem Solving Exercises with Algorithms and Pseudocode 91

Unit 2: Introduction to Python and Data, Expressions, Statements

Chapter 3 Introduction to Python 117


3.1 Introduction 117
3.2 Python Overview 117
3.3 Getting Started with Python 118
3.4 Comments 123
3.5 Python Identifiers 123
3.6 Reserved Keywords 124
3.7 Variables 124
3.8 Standard Data Types 126
3.9 Operators 132
3.10 Statement and Expression 142
3.11 String Operations 143
3.12 Boolean Expressions 145
3.13 Control Statements 146
3.14 Iteration – while Statement 152
3.15 Input from Keyboard 154
Always Remember 156
Key Terms 157
Review Exercises 157
Multiple Choice Questions 161
Short Questions 162
Answers to Multiple Choice Questions 162

Unit 3: Functions

Chapter 4 Functions 165


4.1 Introduction 165
4.2 Built-in Functions 165
4.3 Composition of Functions 171
4.4 User Defined Functions 172
Contents vii

4.5 Parameters and Arguments 175


4.6 Function Calls 179
4.7 The return Statement 180
4.8 Python Recursive Function 181
4.9 The Anonymous Functions 181
4.10 Writing Python Scripts 183
Always Remember 185
Key Terms 186
Review Exercises 187
Multiple Choice Questions 192
Short Questions 193
Answers to Multiple Choice Questions 194

Unit 4: Lists, Tuples and Dictionaries

Chapter 5 Strings and Lists 197


5.1 Strings 197
5.2 Lists 209
Always Remember 217
Key Terms 218
Review Exercises 219
Multiple Choice Questions 226
Short Questions 229
Answers to Multiple Choice Questions 232

Chapter 6 Tuples and Dictionaries 233


6.1 Tuples 233
6.2 Dictionaries 244
Always Remember 251
Key Terms 252
Review Exercises 253
Multiple Choice Questions 259
Short Questions 262
Answers to Multiple Choice Questions 264

Unit 5: Files, Modules and Packages

Chapter 7 Files and Exceptions 267


7.1 Text Files 267
7.2 Directories 277
7.3 Exceptions 279
viii Contents

7.4 Exception with Arguments 285


7.5 User-Defined Exceptions 286
Always Remember 288
Key Terms 289
Review Exercises 290
Multiple Choice Questions 295
Short Questions 297
Answers to Multiple Choice Questions 298

Chapter 8 Classes and Objects 299


8.1 Overview of OOP (Object-Oriented Programming) 299
8.2 Class Definition 300
8.3 Creating Objects 302
8.4 Objects as Arguments 305
8.5 Objects as Return Values 306
8.6 Built-in Class Attributes 307
8.7 Inheritance 308
8.8 Method Overriding 312
8.9 Data Encapsulation 312
8.10 Data Hiding 314
Always Remember 315
Key Terms 316
Review Exercises 317
Multiple Choice Questions 323
Short Questions 325
Answers to Multiple Choice Questions 326

Appendix C: Fundamental Standard Library Modules 327


PrefACe

Developments in the field of digital electronics and the huge amount of data generated during the last
few decades ushered in the second Industrial Revolution which is popularly referred to as the Information
Revolution. Information technology played an ever-increasing role in this new revolution. A sound knowledge
of how computers work, process and analyze data has, therefore, become indispensable for everyone who
seeks employment not only in the area of IT, but also in any other fields. Rightly so, many institutions and
universities in India have introduced a subject covering Problem Solving and Python Programming for their
undergraduate students. This book caters to those needs of the undergraduate students.

Why learn Python?


Python is a high-level, interpreted, reflective, dynamically typed, open-source, multi-paradigm, and general-
purpose programming language. It is quite powerful and easy. It offers no special tools or features that let
you do things that you cannot do with other languages, but its elegant design and combination of certain
features make Python a pleasure to use.

What’s Special in this Book?


The book ensures a smooth and successful transition to a skilled expert in Python. This book uses a simple-
to-complex and easy-to-learn approach throughout the book. The concept of ‘learning by-solving’ has been
stressed in all the chapters of the book. Each feature of Python is treated in-depth followed by a complete
program example to illustrate its use. Wherever necessary, concepts are explained pictorially to facilitate
better understanding. It presents a contemporary approach to programming, offering a combination of theory
and practice.
Each of the 8 chapters follow a common structure with a range of learning and assessment tools for
instructors and students.

Salient Features of the Book


The salient features of the book include the following:
● Bottom-up approach of explaining concepts has been adopted in the book.
x Preface

● Algorithms and flowcharts have been discussed extensively in an appendix.


● Codes with Comments have been provided throughout the book to illustrate the use of various features
of Python.
● Supplementary Information and important notes that complement, but stand apart from the text, have
been included in special boxes under the head Notes.
● Always Remember consists of important summary points at the end of every chapter to help the readers
recollect the topics covered with ease.
● Check Your Understanding helps the readers evaluate their learning after every section within the
chapters of the book.
● Important Key Terms within the chapter have been listed at the end.
Review Exercises comprising Multiple choice questions along with answer keys, short questions and
programming exercises are provided at the chapter end to help readers test their conceptual understanding.

Organization of the Book


The book spans across eight chapters spread over 5 Units. The first two chapters introduces the learner to
digital computers–the basic structure, programming languages, operating systems, problem solving strategies
and conventional introduction to programming. The next six chapters present a more-or-less the conventional
introduction to programming. The readers learn about variables, types, statements, conditionals, loops,
functions, recursion, classes and inheritance. In all the chapters, first the basic ideas are explained, and
then the reader is led through a process of experimentation that helps them find and test the limits of their
understanding.

Publisher’s Note
Remember to write to us. We look forward to receiving your feedback, comments, and ideas to enhance
the quality of this book. You can reach us at info.india@mheducation.com. Please mention the title and
authors’ name as the subject. In case you spot piracy of this book, please do let us know.
Unit 1
Introduction to Computing and
Algorithmic Problem Solving

Chapter 1: Introduction to Digital Computer


Chapter 2: Problem Solving Strategies
Appendix A: Practice Exercises with Algorithm and Flow Chart
Appendix B: Problem Solving Exercises with Algorithms & Pseudocode
IntroductIon to
1 dIgItal computer

1.1 IntroductIon
In earlier days, the term “digital computer” was used to refer a person who drew mathematical tables and
solved complex calculations. In less than a human lifetime, computers have changed from massive, expensive
and unreliable calculators to the dependable and versatile machines that are now omnipresent in society.
Computers were once the size of rooms and used to take a day to change the program and now, it is just a
double click away. Computers help the impossible become possible. They have become a necessary tool in
today’s society. Without computers, it is hard to do pretty much anything. Computers process information in
1’s and 0’s (usually referred to as On and Off respectively). This operation identifies instructions in Binary
Code. This is the language understood by the computer to complete a command. By 1953, it was estimated
that there were almost 100 computers in the world.
It is believed that the first computer was invented in Berlin, Germany, in 1936.
● The Z1 was invented in 1936 by Konrad Zuse in Germany. This was a programmable machine that

was able to remember numbers. This process is now referred to as memory.


● IBM followed suit and introduced the Harvard Mark 1 which was completed at Harvard University in

1944. It was a large calculator. This computer was able to calculate many different types of numbers.
● With the advancement of technology and research, major companies like IBM, Apple, and Intel have

contributed to the explosion of the personal computers as we know today. For example, Apple 1 was
released in 1976 which was having memory of 4 KB expandable to 8 KB. The Macintosh was released
in 1984 which was having memory of 64 KB expandable to 256 KB.
● CSIRAC was the first computer to play digital music in 1949.

● UNIVAC 1 was used by CBS to predict the results of the 1952 presidential elections in USA.

● On December 2, 1954 IBM’s NORC calculated PI 3089 digits.

● In 1958, Jack Kilby invented the Integrated Circuit.

● COBOL (Common Business Oriented Language), one of the oldest programming languages, was

developed by Grace Murray Hopper in 1959,


● In 1962 Space War, the first computer game was written by MIT student Steve Russell.

● In 1975, the first personal computer Altair 8800 was invented.

● In 1976, Intel & Zilog introduced new microprocessors


4 Problem Solving and Python Programming

● Single - board computer known as apple -1 was designed by Steve Wozniak some more important
developments and was marketed by his friend Steve Jobs.
● In 1980 IBM introduced its Personal Computers (PC). The first IBM PC was known as IBM Model

5150, was based on a 4.77 MHz Intel 8088 microprocessor


● In 19993, Pentium microprocessor was released by Pentium followed by the release of Microsoft

window's NT
● In 1994 Sony entred the home gaming market with release of play station console.

● In 2006, Amazon web services launched cloud-based services.

A Personal Computer (PC) is a digital computer designed for the usage by one person at a time. PCs
can be classified into desktop computers, workstations and laptop computers. Today, PCs have five major
applications which are as follows:
1. Internet Browser: Internet browser is a software application used to access the Internet. For example,
Internet Explorer, Firefox, Opera, etc., are all Internet browsers.
2. Data Compression Software: Data compression software is used to reduce file size. ZIP is widely used
as the data compression software on personal computers.
3. Windows Media Player: Windows Media Player is used to create music libraries for listening music.
4. Image Editing Software: Image editing software is used to develop good quality pictures. Examples of
such software include Photoshop, Microsoft Publisher and Picasa.
5. Audio Editing Software: Audio editing software is used to edit audio files and also to add audio effects.

Check Your Understanding


1. What is a computer?
Ans. A computer is an electronic device capable of executing programs written in different languages.
2. What is the use of data compression software?
Ans. Data compression software is used to reduce file size.

Note The first personal computer was Altair 8800. Later IBM introduced IBM PC.

Computers have become an integral part of the society because of the following characteristics they
possess:
● A computer can perform millions of calculations in a second.

● A computer works with precision every time.

● A computer can store billions of bytes of information. For example, the capacity of a terabyte =

2,00,000 songs.
● A computer can work continuously without getting tired.

● A computer can be used to perform various tasks simultaneously.

● A computer will remember the information stored for as long as required.


Introduction to Digital Computer 5

1.2 Von neumann concept


In early computers, the data and instructions were not stored in the same memory. However, such storage
became possible in the Von Neumann architecture, also known as “stored program” architecture because
it could store the program and instruction data in the same memory. In the Von Neumann architecture,
computers can perform complex operations within less time. Besides performing calculations, they can
manage to do a sequence of calculations as well. The basic structure of Von Neumann architecture consists
of the memory, processing unit and the control unit.
The characteristics of Von Neumann architecture are as follows:
1. The hardware system comprises the following:
● Memory: In Von Neumann architecture, there is a main memory system – Random Access
Memory (RAM) which holds the data or program.
● Arithmetic Logic Unit (ALU): As the name suggests, this is useful in arithmetic and logical
calculations such as addition, subtraction, division and comparisons.
● Control Unit: In the central processing unit (CPU), there is a control unit (CU) managing
the process of data or program. The execution of the program is done by the Control Unit. For
example, the fetch-decode-execution.
Input-Output System: Using this system, an input is given and output is generated after

execution. The information can be stored by using compact disk (CD), floppy, etc.
2. Data or programs are stored into the main memory.
3. Processing of instructions is sequential.

Note A process describes how the processor takes the data or program, decodes it and
finally executes it. The fetch-decode-execute cycle is also known as the Von Neumann
execution cycle.

Check Your Understanding


1. Who developed the basic architecture of computers?
Ans. John Von Neumann
2. What do the following terms stand for?
CPU, ALU, CU, RAM
Ans. CPU: Control Processing Unit
ALU: Arithmetic Logic Unit
CU: Control Unit
RAM: Random Access Memory

1.2.1 A Simple Model of the Computer


A Computer system has three basic components which are as follows:
Discovering Diverse Content Through
Random Scribd Documents
organizations in a number of cities. This culture is, however, almost
exclusively devoted to the maintenance of traditional European
standards, and is inclined to take slight cognizance of the native and
democratic developments in which the true national progress of the
present lies. The presence of such a culture in America is therefore
not altogether an unmixed blessing; in fact it may lead to certain
results of positive evil. The presence of retrospective hyper-
refinement in a nation at a time when rugged creative strength, even
if crude in its artistic results, should be manifested, may be harmful
in its effect upon normal creative progress, especially when, with the
backing of wealth, the press, and the academy, it arrogates to itself
the possession of the true vision of artistic standards.

If, then, the tide of musical appreciation in America has reached a


normal level, in accordance with the general civilization of the world
of to-day, if the appreciative era, purely as such, is past, the creative
epoch has only fairly begun. America, in musical composition,
already reckons a historical sequence approaching to a classical, a
romantic and an ultra-modern period, exhibiting the strange
spectacle of most of the founders of the first period living to see the
flowering of the last, during their active lifetime. In fact, some of the
pioneers have actively engaged in fostering the issues of all three
epochs. The truth of this curious condition is that this triple-aspected
development of the past fifty years can not in reality be said to
represent even the beginning of the actual creative epoch of the
nation. As the child is said to pass through phases corresponding to
the entire ancient history of the race, so this chapter in American
music represents the rapid passage of the youthful America through
the previous history of the art; it has represented the desire to catch
up with the world at large. Even if some works of lasting value have
been produced, as is undoubtedly the case, this period has in
actuality represented a mere reflex of European musical civilization,
a surface agitation, to be followed by an authentic and original
national productivity along the lines of its own needs and ideals.

So irregular and tumultuous have been the conditions of musical


development in America, that early influences have been of relatively
small qualitative importance in determining the ultimate issues of
American music. There are but two such early influences of
importance to record, and one of these has become wholly negligible
with relation to our independent art of music, finding its only resultant
effect in the church music of America. This, attributable in the first
instance to the Netherland school of the Renaissance, appeared as
the early English contrapuntal school of Purcell, becoming
associated with the music of the Protestant Church in England, and
finally becoming diluted to the productions of the school of Billings
and Hopkinson in America. American hymnology undoubtedly owes
its character to this evolutionary sequence, although in the end
American church music has become inundated with the German
influence in its more sentimental aspects, and presents in general a
profound degeneration too momentous for discussion in the present
brief review. The one great original influence acknowledged by the
nation, in its musically creative life, is the mighty German tradition of
the epoch of Beethoven. It is significant and fortuitous that America
was colonized, musically, at the time when the influence of that
tradition was paramount in the world. It was the emigrating German
music teacher, in every city and town of the United States, who
implanted the fundamental conception of musical art in American
civilization. Accepted and consulted everywhere, he determined the
character of music in America in the period of reconstruction and
educational expansion after the Civil War. His influence was
solidified by the character of symphonic and choral enterprise, and
by that of the performances of German musical artists touring in
America. The Italian was the accredited opera singer and nothing
more; the German was the teacher.

In the subsequent course of developments, two matters have


militated against the ultimate domination of the German influence in
American composition. One is the extensive change which has since
occurred in the racial nature of the population. Continued
immigration from all lands has eventually produced a population too
diverse to accept and perpetuate, as its dominant musical character,
the tradition of any one nation, however musically great. The other is
the amazing musical awakening of all Europe since the epoch of
Beethoven, and especially since Wagner, and the consequent
deluge of modern music from various nations which has poured in
upon American musical life. In view of the infinity of newly revealed
possibilities, the American composer has been unwilling to continue
to reflect merely the one tradition with which his nation was formerly
acquainted, in howsoever high honor that tradition was held. It is to
be said, however, that the substantial character of German formal
musical construction has exerted, as it should, a permanent
influence upon the American attitude toward composition, and one
which is certain to operate beneficially upon the creative musical life
of the nation. The American point of departure has been one not so
much of technical system and ideals generally, as of temperament.

A third matter qualifying this emancipation of American music is the


unearthing of the mass of aboriginal folk music peculiar to America,
particularly that of the Indian and the negro. This has had a far more
significant and widespread influence upon composers in America
than critics in general have been willing to admit, and many of the
strongest works now appearing in this country acknowledge an
influence from these sources.

The 'American folk-song' discussion arose after what has been


termed the classical period of American music, of which J. K. Paine
may be considered the founder, and during the period in which the
romantic influence, culminating in the work of MacDowell, was
beginning to yield to the influence of the ultra-moderns. The factors
which broke the exclusive German domination in America were, on
one hand, the following up on this side of the water of the musical
individuality gained by other European nations, and, on the other
hand, the movement for the development of aboriginal folk-song in
America. To these causes, some may add a spontaneous climatic
influence, but of this there has as yet been no material
demonstration.

The gist of the folk-song discussion was the question as to whether


the basis of a characteristic national American musical art was to be
found in the music of the negroes or Indians. This discussion arose
after Antonin Dvořák's proclamation of such a possibility during his
sojourn in America in the years 1892-95, and rose to its height
several years after the foundation in 1901, by the writer, of The Wa-
Wan Press, a movement for the attainment of a greater freedom in
American music along both modern European and American
aboriginal lines. As in all such matters, the question was answered
by the degree and quality of creativeness in the works brought
forward in exemplification of the principle. Good works on Indian or
negro themes have lived, and bad ones have died. It soon became
plainly evident that there was no popular prejudice against music
drawing upon the characteristics of these native aboriginal sources;
on the contrary, much interest was evinced, as has frequently been
shown by the attitude of audiences listening to such works and by
the popularity which certain of them have attained. The subject has
also been made one for special study by numerous musical clubs
throughout the country. What was asked was merely that the result
should be good music. The influence of Indian and negro music
upon American composition has thus spontaneously come to be
recognized as a national and acceptable one, and the reflection of it
by American composers to-day arouses scarcely a murmur of
comment. That only a certain proportion of composers in America
would respond to these influences was soon perceived, and with the
readiness of the people to accept this kind of work, it became merely
a question of the proportion of American musical art which should
exhibit these tendencies. There appears to be no diminution of the
tendency of many composers to draw upon these apparently
inexhaustible aboriginal sources, and with the constant advance of
creative musical art in America, and with its eagerness to press to a
conclusion every available phase of music susceptible of
development, there is every reason to believe that this influence,
now generally recognized, will lead to a very considerable mass of
achievement of a high character. America is too diverse in its
sympathies and ideals to acknowledge any one national or racial
influence as paramount in its musical art, but absolute creative
freedom is essential to its national character.
Upon the original German influence, which has been rapidly modified
in America by the work of Wagner and Strauss, there has followed
chiefly the influence of modern France. Many American composers
have lent themselves with avidity to the assimilation of the new
technical resources revealed by Debussy and his colleagues, with
excellent results so long as they considered these merely as
accretions to their previous resource, but in general with equal failure
where they have thought to create in the spirit of the French idiom.
The directness of Russian musical expression has made its appeal
to American composers, though its influence upon the color of
American music has been inconsiderable in comparison with the
French. The one cumulative effect of the many influences, from
within and without, which have qualified the nature of American
music, especially during the last two decades, has been to wrench it
free from the uninspiring and nationally inappropriate character
which it had acquired as the result of its original exclusive early
German influence, without, it is to be noted, leading it into imitative
subservience to the particular character of the musical art of any
other nation. In other words, America has gained its creative musical
freedom, even if still too new to that condition to manifest its ultimate
results. With this widened horizon, the true creative epoch of
American music has only now begun. The handful of American
composers of serious ideals and noteworthy ability who could be
named a few years ago has increased to scores, and new names
appear in such rapid succession that the fairly definite knowledge
which America had of its chief composers of the 'classical' and
'romantic' epochs can give only the feeblest conception of the
present condition of composition in America. The best of the newer
work shows a loftiness of ideals, a breadth of outlook, a definiteness
of purpose, a freshness of color, a sense of the beautiful and an
esprit which argue strongly for the future honor of American music.
The chief danger which threatens the American composer is the
tendency to accept and conform to the standards of the centres of
conventional and fashionable musical culture, especially in
unsubstantial modern aspects, and to fail to study out the real nature
and musical needs of the American people. Such a tendency
naturally lingers with the lingering domination of Europe over the
standards and the machinery of American musical life. Conformity
means representation and a certain sort of acclaim for the composer;
nonconformity means severance from the usual and conventional
centres and institutions of musical culture. Critical approbation does
not mean the response of the people; the composers most highly
acclaimed by the critics can by no means be said to have come
closest to touching the national heart. The attitude of the world of
musical 'culture' in America is still cold toward the native producer;
this narrow American 'culture' world pays for the maintenance of
fashionable foreign standards, and resents any interference with this
course. Concert singers are seldom heard in American songs worthy
of their artistry, and orchestral conductors seldom give, on their own
initiative, successful native orchestral works, an isolated
performance of which has been arduously procured elsewhere.

With the people generally, however, the matter is quite otherwise.


The people of the nation have never shown a disposition to receive
otherwise than cordially the work of their own composers. From
Stephen Foster, through the ranks of popular music composers, to
MacDowell, to many song composers of the present, and latterly to
the composers of music for popular festivals and pageants—
wherever the composer has gone directly to the people and served
their needs, whether in the sphere of lesser or greater ideals, he has
found a ready welcome and a hearty response. The pathway of true
creativity, of healthy growth and achievement for the composer in
America to-day, lies in abandoning the competition with European
sensationalists and ultra-modernists in the narrow arena of the
concert halls of 'culture', and turning to the fulfilment of national
needs in the broadest and deepest sense.

The accomplishment of this matter is linked with the third and last
general division of our main subject, the question of administration.
As a natural consequence of events in American musical history,
dating from the earliest days, there has arisen the so-called 'musical
world' of America to-day, the well-defined national system of concert,
recital and operatic life. This system arose normally to supply the
new world with the products of the highly developed musical art of
the old, and in such a capacity it has admirably served its purpose.
In the course of time, however, and with the increasing wealth and
musical culture of America, the harvest to be reaped by the
commercial exploitation of foreign artists has not remained
unperceived by a country not naturally backward in the perception of
commercial advantage. It is quite natural that those who took into
their hands the management of these affairs should seek the
greatest profit which they could be made to yield. This, it will readily
be seen, was not to come from the broad development of a given
locality, which would involve education and a departure from the
centres of wealth, but from the exploitation of the narrow circle of
wealth and culture which existed in every community of importance.
Thus a great circuit was established throughout the country, by
which a process of skimming the cream from as many communities
as possible was set in operation, in the presentation of famous
foreign artists to what has been allowed to pass as the American
public. Thus a system established originally as a service to the
people has finally degenerated to the condition of a commercial
enterprise which is utterly without regard to the broader interests of
the people. The true condition of affairs is made evident to-day by
the fact that when a resident of any moderate-sized prosperous
American city starts to inaugurate some local musical enterprise for
the benefit of the whole community, and calling for the entire
community's support, he learns that the concert and recital life of his
city, its 'musical world,' reaches and is supported by but from three to
five per cent. of the entire population. The other ninety-five to ninety-
seven per cent. find the regular musical events beyond their means,
as well as beyond the facts of their culture, though in the latter
respect America is now rapidly learning that the enjoyment of the
best music is far less dependent upon special education than has
commonly been supposed.

Meanwhile, by phonograph and player-piano, by newspaper and


magazine, by high-class municipal concerts and occasional chance
glimpses into the world of greater musical possibilities, the mass of
the people have begun to become awakened to the existence of the
larger musical world which they do not see and the larger musical life
which they do not share, and to crave participation in it. Finally,
therefore, we have the spectacle of an American 'musical world'
which is no longer true to American conditions and which does not
serve the people. In short, we have finally come face to face with the
problem of the reaction of musical art and democracy.

With this question the nation has of late begun to deal in no half-
hearted or uncertain manner. In fact, the national response to this
situation involves the greatest American musical movement of the
day. In its earlier phase the question asked was: Will the people,
under democracy, rise to the accepted standards of musical culture?
A negative answer to this question has been generally entertained,
and among cultured people it has been commonly supposed that
democracy would drag down the standards of musical culture. That a
wholly new and multifold phase of musical life would arise to meet
the requirements of a civilization such as that of America seems to
have been earlier suspected or foreseen only by a few thinking
students of conditions, who recognized the fact that the exact
meeting of the mass, as it became more enlightened, with the
conditions of traditional musical culture was not the solution which
was to be expected or even desired. The plain fact was that the
people at large were not enjoying the benefits, the pleasure,
recreation, or inspiration, as the case might be, of all that the world
prizes as music in any of its forms above that of popular songs and
dances. Neither the educational system, on the one hand, nor the
cultural system, on the other, provided them with it. One merely gave
a little elementary training of the most primitive sort, and for a short
time, to children, and the other did not reach beyond the extremely
restricted sphere of culture and wealth. A movement was needed
which should bring music in all of its forms directly to the masses of
the people, and in the nation-wide campaign for what may be termed
'music for the people' such a movement has arisen. Experiments on
every hand have shown that the people have needed only to be
brought in contact with the higher forms of music, under
advantageous conditions, to rise spontaneously to the enjoyment of
it. The movement, in its activities, has assumed no particular form,
but has taken a variety of forms according to the possibilities of local
conditions. The 'Forest Festival,' or 'Midsummer High Jinks,' of the
Bohemian Club in San Francisco, while not open to the general
public, has nevertheless shown the potent appeal of outdoor musical
dramatic festivals to a large number of persons not commonly in
touch with musical life. Municipal concerts on a scale not hitherto
attempted, such as those in Central Park, New York, presenting not
band, but orchestral concerts of the world's greatest music, have met
with an astonishing and enthusiastic response on the part of the
masses who have hitherto had no opportunity of hearing anything
above the popular music of the streets, the dance halls, and the
'movies.' The musical phase of the social centre movement has
assumed vast and national proportions, making use of the public
school halls for concerts and recitals for thousands of persons who
were previously without musical opportunities. Certain towns, such
as Bethlehem, Pa., Lindsburg, Kans., and the towns of the 'Litchfield
County Choral Union,' Conn., have established choral enterprises
which include in the choruses practically the entire population. In two
years the custom of Christmas trees with music, free to the people,
has become almost a national movement. The 'community chorus,'
such as that established in Rochester, N. Y., with a membership of
nearly one thousand drawn from the people at large, and singing in
the public parks and school halls, should prove a desirable form of
people's musical enterprise in many places. Standard symphony
orchestras in various cities are branching out extensively in the
direction of giving concerts involving the highest order of music to
the people at popular prices, and in some cities the organization of
symphony orchestras for popular price concerts is threatening the
existence of the regular orchestra. And well-nigh surpassing in
significance most other phases of the general movement, and
certainly in their popular inclusiveness, are the pageants or
'community dramas' with music, which are now constituting a feature
of community life throughout the country.

If, then, the appreciative epoch along the older lines, is concluded in
America, it may be said that the nation is coming to a new
appreciation of music, as a whole, in its relation to humanity. The
new movement will call forth new and larger efforts on the part of
American composers, who, with their present thorough assimilation
of the various musical influences of the world, will lead the nation
into a new and mature creative epoch.

Arthur Farwell.

August, 1914.
CONTENTS OF VOLUME FOUR

PAGE

Introduction by Arthur Farwell vii

Part I. Appreciation
CHAPTER

I. Our English Inheritance 1


The foundation of American musical culture—State
of English musical culture in the
seventeenth century—The Virginia colonists—The
Puritans in England and in America; New England
psalmody.
II. Beginnings of Musical Culture in America 22
The foundations of American music—New England's
musical awakening; early publications of
psalm-tunes; reform of church singing—Early
concerts in Boston, New York, Philadelphia, the
South—The
American attitude toward music—The beginnings of
American music: Hopkinson; Lyon; Billings and their
contemporaries.
III. Early Concert Life 55
Sources of information—Boston Concerts of the
eighteenth century; New England outside of
Boston—Concerts Concerts in Philadelphia; open-
air concerts—Concert in New York—life of the
South; Charleston,
Baltimore, etc.; Conclusion.
Part II. Organization
IV. Early Musical Organizations 84
Origin of musical societies—The South; The St.
Cecilia of Charleston; Philadelphia and New York in
the
eighteenth century—The Euterpean Society; the
New York Choral Society; Sacred Music Society;
other New York
Societies—New Society of Boston; other societies in
Boston and elsewhere.
V. The Beginnings of Opera 104
Scantiness of theatrical performances in America;
Charleston and Tony Aston; New York, Philadelphia
and
elsewhere—The Revolution and after; rivalry
between New York and Philadelphia—The New
Orleans opera.
VI. Opera in the United States. Part I: New York 117
The New York opera as a factor of musical culture—
Manuel García and his troupe; da Ponte's dream—
The
vicissitudes of the Italian Opera House; Palmo's
attempt at 'democratic' opera—The beginnings of
'social' opera:
the Academy of Music, German opera, Maretzek to
Strakosch—The early years of the Metropolitan—
The Grau
régime—Conried; Hammerstein; Gatti-Casazza;
Opera in English—The Century Opera Company.
VII. Opera in the United States. Part II 158
San Francisco's operatic experiences—New
Orleans and its opera house—Philadelphia;
influence of
New Orleans, New York, etc.; The Academy of
Music—Chicago's early operatic history; the
Chicago-Philadelphia
company; Boston—Comic opera in New York and
elsewhere.
Instrumental Organizations in the United
VIII. 181
States
The New York Philharmonic Society and other New
York orchestras—Orchestral organizations in
Boston—The Theodore Thomas orchestra of
Chicago—Orchestral music in Cincinnati—The
Pittsburgh Symphony
Orchestra—Orchestral music in the West; the
Philadelphia Symphony Orchestra—Chamber music
ensembles—Visiting
orchestras.
IX. Choral Organizations and Music Festivals 206
The Handel and Haydn and other Boston societies—
Choral organizations in New York, Pennsylvania,
and elsewhere—Cincinnati, Milwaukee, St. Louis,
Chicago and the Far West—Music festivals.
X. Musical Education in America 230
Early singing teachers and schools—Music societies
in colleges—Introduction of music into the
public schools—Juvenile music—Conservatories—
Musical courses in colleges and universities—
Community
music—Present state of public school music—
Municipal music.
Part III. Creation
XI. The Folk-Element in American Music 277
Nationalism in music—Sources of American folk-
song; classification of folk-songs—General
characteristics
of the negro folk-song—The negro folk-song and its
makers—Other American folk-songs—The negro
minstrel tunes;
Stephen Foster, etc.—Patriotic and national songs.
XII. The Classic Period of American Composition 331
Pioneers in American Composition: Fry, Emery,
Gottschalk—The Boston group of 'classicists':
Chadwick, Foote,
Parker, and others—Other exponents of the
'Classical': William Mason, Dudley Buck, Arthur
Whiting, and others—The
lyricists: Ethelbert Nevin; American song-writers—
Composers of church music.
XIII. Romanticists and Neo-Classicists 360
Influences and conditions of the period—Edward
MacDowell—Edgar Stillman-Kelley—Arne Oldberg;
Henry Hadley; F. S. Converse—E. R. Kroeger;
Rubin Goldmark; Howard Brockway; Homer N.
Bartlett—Daniel
Gregory Mason; David Stanley Smith; Edward
Burlingame Hill—The younger men: Philip Greeley
Clapp; Arthur
Bergh; Joseph Henius; Carl Busch—The San
Francisco Group; Miscellany—Women Composers.
XIV. Nationalists, Eclectics and Ultra-Moderns 407
The new spirit and its various manifestations—Henry
F. Gilbert, Arthur Farwell, Harvey W. Loomis—
Frederic Ayres,
Arthur Shepherd, Noble Kreider, Benjamin Lambord
—Campbell-Tipton; Arthur Nevin; C. W. Cadman; J.
A. Carpenter;
T. C. Whitmer—W. H. Humiston, John Powell, Blair
Fairchild, Maurice Arnold—Sidney Homer; Clough-
Leighter and
others—Charles M. Loeffler and other Americans of
foreign birth or residence.
XV. The Lighter Vein 451
Sources of American popular music—Its past and
present phases—American comic opera: Reginald
de Koven;
Victor Herbert; John Philip Sousa; other writers of
light opera—The decline of light opera and the
present state of
theatrical music.
Literature 465
Index 469
MUSIC IN AMERICA
CHAPTER I
OUR ENGLISH INHERITANCE

The foundation of American musical culture—State of English


musical culture in the seventeenth century—The Virginia colonists
—The Puritans in England and in America; New England
psalmody.

Whatever else the American music-lover may be, he is decidedly not


chauvinistic. Deprecatingly he is wont to speak of native artistic
accomplishment, and, however much he may be disposed to vaunt
the stellar achievements of our few great opera houses and
orchestras, he is content to draw a veil of modest silence over that
part of our musical history which precedes the advent of those de
luxe organizations. Hence it is, perhaps, that the searchlight of the
historian has played but fitfully upon the early musical life of America
—for, although popular interest may not inspire the writing of history,
it is not without its influence on the publication thereof. Possibly the
musical life of pre-Revolutionary America has had little to do with
shaping the ultimate artistic destinies of the nation, yet it formed the
matrix into which our subsequent musical culture has been
embedded and as such it is of both interest and importance to those
who would follow a phase of our national development, as yet
regrettably neglected.

It is a peculiar tendency of the American historian to lay the


foundation of our national history squarely on the Rock of Plymouth.
A solid foundation, truly, but not a very broad one. The predominant
influence of New England in the industrial and commercial
development of the United States can hardly be gainsaid. That its
influences on the country's æsthetic development have been equally
predominant is questionable. More especially in musical matters are
we inclined to call it into dispute. If we might judge from American
popular music, we should be disposed to infer that such influences
as may have been active in the shaping of it came chiefly from the
South. Nor is popular music a negligible criterion in this respect, for
in it have always lain the germs of truly national art. Of course, our
knowledge of the state of musical culture in the early colonies does
not enable us to say definitely and dogmatically just where and how
American musical development first began. It will probably appear
eventually that the early musical life of the colonies has had very
little to do with our musical culture of to-day. But, purely as a matter
of historic justice, it might be pointed out that unqualified statements,
such as the assertion of Ritter that 'the first steps of American
musical development may be traced back to the first establishment
of English Puritan colonies in New England,' are, to say the least,
somewhat premature.[1]

I
A consideration of music among the Indians is not germane to our
present purpose. As far as we are concerned Indian music is an
exotic, and it is only of recent years that American composers have
turned to it in a conscious search for national color which is,
perhaps, the first real symptom of aspiration toward characteristically
national expression. From the point of view of musical history the
development of American music must be considered as beginning
among the first white settlers on these shores, and it may be said at
once that those beginnings, like Guy of Warwick's death, are still
'wrop in mystery.' Regarding musical life in the colonies before the
year 1700 our information is so slight as to be negligible. For almost
a century preceding that year white men—many of them men of
culture—had been settled in America.[2] That these men completely
forgot the art in which so many of them found pleasure, and in which
at least a few of them must have possessed some skill, is a
supposition too absurd to be seriously entertained. As to the nature
and proportions of their musical activities we have no exact evidence
and, in default of such, it is necessary for us to dip a little into
comparative history.

In England the curtain of the seventeenth century rose on a country


that as yet knew not cropped heads nor Geneva cloaks nor steeple-
crowned hats nor the snuffling drone of Hop-on-High-Bomby
mournfully mouthing the sinfulness of the flesh and the menace of
the wrath to come. England still deserved its old-time appellation of
'merrie.' It still ate and drank, sang and swore, bussed and wantoned
blithely, lustily, as befitted a country with a full purse, a sound
constitution, and a healthy indifference to the disturbing subtleties of
theology and metaphysics. It was a robust, Falstaffian England, still
unregenerate, still addicted to sack and loose company, but with a
mind as clearly keen as a Sheffield blade and a heart as soft and
impressionable as its own Devonshire butter—'pitiful-hearted butter
that melted at the sweet tale of the sun.' In short, a normal, vigorous,
able-bodied, human country, not yet soured by the virus of an
acidulated Puritanism, nor devitalized by the distemper of a
cultivated licentiousness; a country in whose fertile soil the seeds of
art might well germinate and flourish apace. And, as a matter of fact,
English music, like English drama and poetry, was then approaching
the culmination of its golden age. In Italy, Palestrina had just died;
Peri and Monteverdi were shaping the beginnings of opera; the
madrigal, the mystery, the morality and the masque were the
prevailing media of secular musico-literary expression, while popular
instrumental music was represented by Pavans, Galliards, Allmains,
Courantes, and other courtly-sounding forms. The stern, strict god of
polyphony was already stooping to flirt with the light and wayward
muse of the people, making the first tentative advances toward a
union from which was destined to spring a seductively human art.
Never since has England stood so high musically among the nations
of Europe. Never since has she produced composers who so closely
rivalled the greatest of their contemporaries. There was William Byrd
'a Father of Musicke,' as the Cheque-book of the Chapel Royal has it
—one of the most learned contrapuntists of his time and unequalled
by any of his contemporaries in compositions for the virginals. There
was John Dowland, 'whose heavenly touch upon the lute doth ravish
human sense.' There was Orlando Gibbons, one of the greatest
composers of his period, who was then in the beginning of his
distinguished career. These, and many other English composers of
scarcely lesser note, were as highly honored abroad as they were at
home. Their influence on the development of German music has
been admitted even by German critics.[3] In England the madrigal
flourished then as it did nowhere else in Europe and reached a
degree of perfection hitherto unattained even by the best
madrigalists of Italy and the Netherlands. What Peri and Monteverdi
were doing successfully in Italy in the pseudo-Grecian music-drama,
the English were attempting to do, more characteristically though
less successfully, in the masque. Some of the most famous of
English popular songs—like 'The Bailiff's Daughter of Islington,' 'The
Three Ravens,' and 'Drink to Me Only with Thine Eyes'—have come
down to us from that period. Indeed, the musical vitality of the
England of that time was truly remarkable, and thousands of
madrigals, motets, anthems, ayres, and ballets remain as eloquent
witnesses to its teeming fecundity. English instrumentalists were
then rated the best in Europe and were as commonly employed in
the courts of Germany as German instrumentalists are now
employed in the restaurants of London.

Nor was this noteworthy musical activity confined to the small class
of professional musicians. If we may believe Morley,[4] and read
aright the references of Shakespeare and other contemporary
writers, music was sedulously practised by all classes in England,
from the sovereign to the beggar. Queen Elizabeth, we find, played
excellently on the virginals and the poliphant, though it does not
appear that her dour successor took very kindly to such exercises. It
seems to have been a matter of course that every well-reared girl
should sing at sight and play acceptably on the virginals, the flute,
and the cittern. Sight-reading—alas for our degenerate days—was
apparently a universal accomplishment, at least among people of the
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!

ebookmass.com

You might also like