(eBook PDF) Programming Logic & Design Comprehensive 9th Edition pdf download
(eBook PDF) Programming Logic & Design Comprehensive 9th Edition pdf download
https://ebooksecure.com/product/ebook-pdf-programming-logic-
design-comprehensive-9th-edition/
https://ebooksecure.com/download/programming-logic-design-
comprehensive-9th-edition-ebook-pdf/
https://ebooksecure.com/download/programming-logic-and-design-
comprehensive-9th-edition-ebook-pdf/
http://ebooksecure.com/product/ebook-pdf-starting-out-with-
programming-logic-and-design-4th/
https://ebooksecure.com/download/starting-out-with-programming-
logic-and-design-6e-ebook-pdf/
(eBook PDF) Digital Logic Circuit Analysis and Design
2nd Edition
http://ebooksecure.com/product/ebook-pdf-digital-logic-circuit-
analysis-and-design-2nd-edition/
https://ebooksecure.com/download/introduction-to-java-
programming-comprehensive-version-ebook-pdf/
http://ebooksecure.com/product/ebook-pdf-the-logic-of-american-
politics-9th-edition/
https://ebooksecure.com/download/fundamentals-of-logic-design-
enhanced-edition-ebook-pdf/
https://ebooksecure.com/download/digital-logic-microprocessor-
design-with-interfacing-2nd-edition-ebook-pdf/
_oyce Farrel
COMPREHENSIVE
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
••
VII
•
Preface . . • • • • • • • • • • • • • • XVI
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
CONTENTS
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
CONTENTS
••
CHAPTER 10 Object-Oriented Programming. • • • • • • 420
XII
Principles of Object-Oriented Programming • • • • • • • .421
Classes and Objects. • • • • • • • • • • • • • • • • .421
Polymorphism. • • • • • • • • • • • • • • • • • • • .424
Inheritance • • • • • • • • • • • • • • • • • • • • • .426
Encapsulation . • • • • • • • • • • • • • • • • • • • .426
Defining Classes and Creating Class Diagrams . • • • • • .428
Creating Class Diagrams. • • • • • • • • • • • • • • .430
The Set Methods • • • • • • • • • • • • • • • • • • .433
The Get Methods • • • • • • • • • • • • • • • • • • .434
Work Methods. • • • • • • • • • • • • • • • • • • • .435
Understanding Public and Private Access • • • • • • • • .437
Organizing Classes • • • • • • • • • • • • • • • • • • .440
Understanding Instance Methods • • • • • • • • • • • • .441
Understanding Static Methods • • • • • • • • • • • • • .447
Using Objects. • • • • • • • • • • • • • • • • • • • • .448
Passing an Object to a Method . • • • • • • • • • • • .449
Returning an Object from a Method . • • • • • • • • • .450
Using Arrays of Objects • • • • • • • • • • • • • • • .453
Chapter Summary . • • • • • • • • • • • • • • • • • • .455
Key Terms • • • • • • • • • • • • • • • • • • • • • • .456
Exercises. • • • • • • • ••• • • • • • • • • • • • • .458
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
CONTENTS
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
CONTENTS
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
•
XVI
Programming Logic and Design, Comprehensive, Ninth Edition, provides the beginning
programmer with a guide to developing structured program logic. This textbook assumes
no programming language experience. The writing is nontechnical and emphasizes
good programming practices. The examples are business examples; they do not assume
mathematical background beyond high school business math.
Additionally, the examples illustrate one or two major points; they do not contain so
many features that students become lost following irrelevant and extraneous details. The
examples in this book have been created to provide students with a sound background in
logic, no matter what programming languages they eventually use to write programs. This
book can be used in a stand-alone logic course that students take as a prerequisite to a
programming course, or as a companion book to an introductory programming text using
any programming language.
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
Organization and Coverage J
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
This text focuses on helping students become better programmers, as well as helping them
understand the big picture in program development through a variety of features. Each
chapter begins with objectives and ends with a list of l<ey terms and a summary; these
•• •
XVIII useful features will help students organize their learning experience.
105
eclarations
num originalNumber
num calculatedAnswer
Yes
input
No
originalNumber
stop
calculatedAnswer =
originalNumber * 2
output
calculatedAnswer
tested. Instead, a result is calculated and displayed one last time before the loop-controlling
test is made again. If the program was written to recognize eof when ori gi na1 Number is 0,
then an extraneous answer of O will be displayed before the program ends. Depending on
the language you are using and on the type of input being used, the results might be worse:
The program might terminate by displaying an error message or the value output might
be indecipherable garbage. In any case, this last output is superfluous-no value should be
doubled and output after the eof condition is encountered.
As a general rule, a program-ending test should always come immediately after an input
statement because that's the earliest point at which it can be evaluated. Therefore, the best
solution to the number-doubling problem remains the one shown in Figure 3-16-the
structured solution containing the priming input statement.
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
Understanding Simple Program Logic
Computer memory consists of millions of numbered locations where data can be stored. The memory
location of myNumber has a specific numeric address, but when you write programs, you seldom need
to be concerned with the value of the memory address; instead, you use the easy-to-remember name
you created. Computer programmers often refer to memory addresses using hexadecimal notation,
or base 16. Using this system, they might use a value like 42FF01A to refer to a memory address.
Despite the use of letters, such an address is still a number. Appendix A contains information about the
hexadecimal numbering system.
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
ssess
xx
______fl~f!!i~ii!!wtii...!!..!::!:!!.
. .!:!_[~.:.:
An Overview of Computers and Programming
Exercises
3. Design a flowchart or pseudocode for a program that accepts three numbers from
a user and displays a message if the sum of any two numbers equals the third.
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
ASSESSMENT
PERFORMING MAINTENANCE
exercises ask students to modify
working logic based on new tes a gross production
requested specifications. This d by multiplying a player's •
's slugging percentage, and XXI
activity mirrors real-world tasks
that students are likely to ogram for Arnie's
85
encounter in their first programming for a refrigerator model
hes. Calculate the
jobs. the height, width, and
Performing Maintenance
1. A file named MAINTENANCE02-01.txt is included with your downloadable
student files. Assume that this program is a working program in your
organization and that it needs modifications as described in the comments (lines
that begin with two slashes) at the beginning of the ftle. Your job is to alter the
program to meet the new specifications.
1. rgam hold your interest, they almost always include some random,
predict le behavior. For example, a game in which you shoot asteroids loses
e of i fun if the asteroids follow the same, predictable path each time you
y. Ther ore, generating random values is a key component in creating most
•• • Clear explanations. The language and explanations in this book have been refined over
XXII
eight editions, providing the clearest possible explanations of difficult concepts.
• Emphasis on structure. More than its competitors, this bool, emphasizes
structure. Chapter 3 provides an early picture of the major concepts of structured
•
programming.
• Emphasis on modularity. From the second chapter onwards, students are encouraged
to write code in concise, easily manageable, and reusable modules. Instructors have
found that modularization should be encouraged early to instill good habits and
a clearer understanding of structure.
• Objectives. Each chapter begins with a list of objectives so that the student knows the
topics that will be presented in the chapter. In addition to providing a quick reference to
topics covered, this feature provides a useful study aid.
• Chapter summaries. Following each chapter is a summary that recaps the program-
ming concepts and techniques covered in the chapter.
• l(ey terms. Each chapter lists l<ey terms and their definitions; the list appears in the
order that the terms are encountered in the chapter. A glossary at the end of the bool<
lists all the key terms in alphabetical order, along with their working definitions.
MindTap
MindTap is a personalized learning experience with relevant assignments that guide stu-
dents in analyzing problems, applying what they have learned, and improving their think-
ing. MindTap allows instructors to measure sl,ills and outcomes with ease.
For instructors: Personalized teaching becomes yours with a learning path that is built with
l<ey student objectives. You can control what students see and when they see it. You can use
MindTap as-is, or match it to your syllabus by hiding, rearranging, or adding content.
For students: A unique learning path of relevant readings, multimedia, and activities is cre-
ated to guide you through basic knowledge and comprehension of analysis and application.
For both: Better outcomes empower instructors and motivate students with analytics and
reports that provide a snapshot of class progress, the time spent in the course, engagement
levels, and completion rates.
The Mind Tap for Programming Logic and Design includes coding labs in C + +, Java, and
Python, study tools, videos, and interactive quizzing, all integrated into an eReader that
includes the full content of the printed text.
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
Acknowledgments ,
Instructor Resources
The following teaching tools are available to the instructor for download through our
Instructor Companion Site at sso.cengage.com.
• Instructor's Manual. The Instructor's Manual follows the text chapter by chapter to •••
XX:111
assist in planning and organizing an effective, engaging course. The manual includes
learning objectives, chapter overviews, lecture notes, ideas for classroom activities, and
abundant additional resources. A sample course syllabus is also available.
• PowerPoint Presentations. This text provides PowerPoint slides to accompany each
chapter. Slides are included to guide classroom presentations, and can be made available
to students for chapter review, or to print as classroom handouts.
• Solutions. Solutions to review questions and exercises are provided to assist with grading.
• Test Bank®. Cengage Learning Testing Powered by Cognero is a flexible, online system
that allows you to:
• author, edit, and manage test banl< content from multiple Cengage Learning
solutions,
• create multiple test versions in an instant, and
• deliver tests from your LMS, your classroom, or anywhere you want.
Additional Options
• Visual Logic™ software. Visual Logic is a simple but powerful tool for teaching
programming logic and design without traditional high-level programming language
syntax. Visual Logic also interprets and executes flowcharts, providing students with
immediate and accurate feedbacl<.
Acknowledgments
I would like to thanl< all of the people who helped to mal<e this book a reality, especially
Alyssa Pratt, Jennifer Feltri-George, I(ristin McNary, I(ate Mason, and all the other
professionals at Cengage Learning who made this bool< possible. Thanks, too, to my
husband, Geoff, and our daughters, Andrea and Audrey, for their support. This bool<, as
were all its previous editions, is dedicated to them.
- Joyce Farrell
Copyright 2018 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-202
Discovering Diverse Content Through
Random Scribd Documents
sind. Die Stadt hat vorzügliche Schulen, darunter die 1911
errichtete deutsche Kaiser-Wilhelm-Schule an der Weihaiwei
Road (Vorschule, Realgymnasium, höhere Mädchenschule),
eine große englische Bürgerschule, Mittelschulen für
Chinesen, eine deutsche Medizinschule (1907 von
deutschem Kuratorium gegründet) zur wissenschaftlichen
Ausbildung chinesischer Ärzte, große moderne
Krankenhäuser für Europäer und Chinesen, unterhält
Sportplätze am Beginn der Bubbling Well Road und im
Hongkiu Park. Elektrische Straßenbahnen durchziehen die
Hauptstraßen. Am Beginn der Bubbling Well Road liegt der
Rennplatz, Eigentum des Shanghai Race Club. Im
Stadtviertel Hongkiu ist eine deutsche evangelische Kirche.
Im französischen Viertel ist die große katholische St.
Josephskirche. Schanghai ist Sitz eines katholischen und
eines anglikanischen Bischofs, eines englischen Gerichtshofs
Supreme Court of China (zur Schlichtung von Streitsachen,
in denen Engländer die Beklagten sind) sowie eines
amerikanischen Obergerichts, des Statistischen Amts der
chinesischen Seezollbehörde sowie einer Abteilung der Royal
Asiatic Society.—Die Chinesenstadt liegt südl. vom
französischen Viertel, ist mit Mauern umgeben und hat
große Vorstädte, in denen am Wasser auch Warenlager
(Godowns) europäischer Kaufleute liegen. Der
Handelsverkehr ist sehr lebhaft, eingeführt werden
Baumwollenstoffe, Opium, Petroleum, Kohlen, Maschinen u.
a., ausgeführt besonders Seide, Tee, Borsten, Federn, Hanf,
Moschus, Galläpfel, Strohgeflechte, Rhabarber, Wachs,
Häute und Talg. Schanghai ist der wichtigste Umschlagsplatz
für alle Erzeugnisse Chinas, weil es durch den Yangtsestrom
mit vielen wichtigen Provinzen gute Verkehrsverbindung hat.
R u n d f a h r t (mit Rikscha, Wagen oder Straßenbahn). Im
Internationalen Viertel ist der Bund die besuchteste
Promenade; mehrere Denkmäler stehen im nördl. Teil, eins
für Sir Harry Parkes vor der Nanking Road, dann das
*Iltisdenkmal (zum Andenken an die Besatzung des am 23.
Juli 1896 vor Kap Schantung gestrandeten deutschen
Kanonenboots) und in dem kleinen Park (Public Garden) am
Nordende des Bund ein englisches Kriegerdenkmal (The
ever victorious army) sowie ein Standbild von Margary; dort
im Sommer Nm. oder abds. dreimal wöchentl. zuweilen
Musik der 50 Mann starken Stadtkapelle (deutscher
Kapellmeister, Prof. Buch).—Hauptgeschäftsstraße ist die
Nanking Road mit sehenswerten Markthallen, in deren
Verlängerung, Bubbling Well Road, der Rennplatz nebst
andern Sportplätzen sowie eine Gartenwirtschaft (St.
George's Farm) und ein europäischer Friedhof liegen.—Das
Villenviertel im W. der Stadt ist neuerdings weit ausgebaut,
eine Spazierfahrt durch die hübschen Alleen ist wegen des
internationalen Treibens sehr interessant. —Im frühern
Amerikanischen Viertel ist Broadway die Geschäftsstraße, an
deren Ende Seide-und Baumwollwebereien liegen. Ein Teil
von Hongkiu ist Villenviertel.—In das Französische Viertel
gelangt man vom Südende des Bund auf einer Brücke über
den Yangkingpang-Kanal, die Fortsetzung des Bund nach S.
bildet der Quai de Wampoo, an dem dicht bei der Brücke ein
Wettersignalturm steht, der die Wetterberichte und
wichtigen Taifunwarnungen des vorzüglichen
meteorologischen Observatoriums der Jesuiten im
benachbarten Zikawei veröffentlicht; die Wetterkarten für
das ostasiatische Gebiet hängen dort (täglich erneut) aus;
außerdem Zeitball (Pl. 14) sowie Wetter-und
Sturmwarnungssignale. Die ersten Gebäude am Quai de
Wampoo sind die Banque de l'Indochine, das Geschäftshaus
der deutschen Firma Melchers & Co. (Agenten des Nordd.
Lloyd etc.), das Gebäude der Messageries Maritimes, das
französische Konsulat und das Gebäude der französischen
»Mission étrangère«. Dann gelangt man zum Quai de
France, wo viele Lagerhäuser (Godowns) liegen.
Hauptstraße der »Concession Française« ist die Rue du
Consulat, in der das Rathaus (Hôtel de la Municipalité) mit
dem Denkmal des Admirals Protet und das Hôtel des
Colonies liegen. Durch die Rue du Consulat und die Avenue
Paul Brunat führt die elektrische Straßenbahn nach Zikawei.
Durch die neuen Stadtteile der Französischen Niederlassung
führen elegante Villenstraßen, so die 11 km lange Avenue
Paul Brunat, an der auch der Deutsche Gartenklub liegt.
Zahlreiche Straßen vermitteln den Verkehr zwischen der
Französischen und der Internationalen Niederlassung.—Die
Chinesenstadt grenzt dicht an das Französische Viertel, ist
mit Mauern umgeben und hat so enge (schmutzige)
Straßen, daß man sie nur zu Fuß oder mit Sänfte besuchen
kann (im Sommer wegen der übeln Ausdünstungen nicht zu
empfehlen). Einige Tempel sind sehenswert, besonders die
Kungfutsze-Pagode und der Tempel der Stadtgötter, in
dessen Nähe das auf einem Teich erbaute alte Teehaus
Husingting nebst Mandarinenklub steht; Marktplatz und
Werkstätten, wo Schnitzereien hergestellt werden, besuche
man im Vorbeigehen. Man nehme einen Führer, da es sehr
schwierig ist, sich in den engen Gassen zurechtzufinden.
Wenn man Kanton gesehen hat, kann man sich den Besuch
der Chinesenstadt von Schanghai ersparen.
Ausflüge: 1) Nach *Zikawei, einer großartigen Niederlassung der
Jesuiten, 8 km östl. von Schanghai, mit elektrischer Bahn (einsteigen
bei Melchers & Co.), Einspänner ($ 3) oder Rikscha auf ebener Straße;
auf den Feldern vor der Stadt viele Gräber. Man fährt dann in einen Park
und durch steinernen Torbogen in den Klostergarten mit Säulenhalle.
Die große Anlage von Zikawei besteht aus vielen Gebäuden, darunter
das Gebäude des Bischofs von Kiangnan, ein Seminar,
Jesuitenkollegium, große Bibliothek, Museum und Wetterwarte,
Waisenhaus für Chinesenmädchen mit Klosterschwesternschule
(sehenswert; 1000 Personen im Kloster, 35 Nonnen; Stickereien,
Klöppeleien werden gefertigt und billig verkauft), Kapelle und
Karmeliterkloster, ein Waisenhaus für Chinesenknaben mit Druckerei,
Maler-und Bildhauerschule; die hier zum Verkauf gestellten
Schnitzereien sind sehr begehrt und preiswert. In der Wetterwarte (zum
Besuch ist Erlaubnis vorher einzuholen) wirken die Jesuitenväter,
insbesondere der berühmte Meteorolog P. Froc zum Besten der
gesamten Schiffahrt in den ostasiatischen Gewässern; ihre
Taifunwarnungen, die mit auf den Beobachtungen der Observatorien
von Hongkong, Manila und neuerdings Tsingtau beruhen, sind wohl die
sichersten Wettervorhersagen, die überhaupt irgendwo gemacht
werden. Daher hat jeder Ostasienreisende alle Ursache, diese Tätigkeit
zu bewundern und den gelehrten Vätern zu danken für die Fürsorge,
die jedem Weltreisenden zugute kommt, da alle Schiffe sich nach den
Sturmwarnungen von Zikawei richten. Hauptklimadaten für Zikawei
nach 34jährigen Beobachtungen: Mitteltemperatur des Jahres 15°, des
Januar 3,1°, des Juli 26,9°. Mittlere Jahresextreme 37,2° und-7,4°.
Jährliche Niederschlagshöhe 1118 mm. Die Jesuitensternwarte in Zose
liegt 20 km von Zikawei auf einem 100 m hohen Hügel. Vom Turm der
Wetterwarte in Zikawei hat man gute Aussicht über die Umgegend.—
Auf dem Weg nach Zikawei kommt man am Lihungtschang-Tempel
vorbei, in dessen Garten ein Bronzedenkmal für den chinesischen
Staatsmann Lihungtschang (in Europa angefertigt) steht. In der Nähe
von Zikawei (Spaziergang 1/2 St. durch saubere Dörfer) liegt hinter
einem dreistöckigen Torbau mit Drachenbildern die siebenstöckige
Pagode Lischuangta in Longhua nahe dem Wusungufer (vom obersten
Stock *Aussicht über die Flußebene; Besteigung aber zurzeit unmöglich,
da die Treppen zerfallen sind). Von dort Rückfahrt mit Wagen (den man
vorher hinbestellen muß) am Kiangnin-Arsenal vorbei (Besuchserlaubnis
vorher einholen!). Diese Fahrt sowie der Gang von Zikawei nach
Longhua sind sehr lohnend zur Zeit der Pfirsichblüte.
2) Hangtschou, tägl. mit der Bahn, Mittagsschnellzug (Speisewagen)
ab Schanghai in 6 St.; oder mit Dampfbarkassen, hübsche Fahrt an
malerischen Ortschaften vorbei und unter gewölbten Brücken hindurch,
über den Vertragshafen Sutschou (einst eine Millionenstadt, aber in der
Taipingrevolution schrecklich verwüstet) oder direkt nach Kiahsing, von
da auf dem Kaiserkanal nach Hangtschou, Hauptstadt der Provinz
Tschekiang, mit etwa 350000 Einw., dem Fremdhandel seit 1896
geöffnet.
Die Fahrt auf dem untern Yangtse und den angrenzenden Strecken
seiner Nebenflüsse ist zwar keineswegs reizlos, doch vermag sie große
landschaftliche Schönheiten nur stellenweise zu bieten; solche steigern
sich erst in dem großartigen Durchbruchstale oberhalb Itschang. Die
Reize einer Yangtsefahrt beruhen hauptsächlich auf dem großen
Verkehr und den interessanten Städtebildern und auf den interessanten
Einblicken in das Wirtschaftsleben des chinesischen Volkes.
Hankau.