Object-Oriented Programming in Python
©2008 |Pearson | Out of print
Michael H Goldwasser, Saint Louis University
David Letscher, Saint Louis University
©2008 |Pearson | Out of print
For introductory courses in object-oriented programming using Python.
With its straightforward syntax and more consistent semantics, Python is developing a solid following among instructors of basic programming. This text presents a balanced and flexible approach to the incorporation of object-oriented principles in introductory courses using Python, providing a solid framework for the development of computer software.
To view downloadable files, click on the Resources tab above.
• Strong fundamentals – Teaches readers how to program in a style that leads them to immediate success, while also gaining a deeper understanding that serves as the foundation for further study.
• Progressive lesson plans – Build upon one another with consistency. EX. A television analogy is introduced as pure design in Ch. 1, then revisited as a tangible class implementation (Ch. 6) and as a base for inheritance (Ch. 9).
• Flexible organization – Allows instructors to reorder or emphasize and deemphasize topics as needed.
• Natural development of object-oriented principles – Familiarizes students with the terminology of object-oriented programming, the concept of an object's underlying state information, and its menu of available behaviors.
• Cases studies with concrete applications – Draw on a wide variety of domains such as animation, puzzles, biology, and math to showcase new techniques and demonstrate the use of computer science in the real world.
• Support for graphics – Includes an exclusive, easy-to-use custom graphics library that helps students grasp basic concepts, while also supporting more advanced explorations into themes such as transformations, double buffering, and event-driven programming.
• Transition to Java or C++ – Lays the groundwork for students’ transition to other languages later in the curriculum, most prominently Java and C++.
• Advanced course material – Provides coverage of more complex topics, including recursion, data structures and algorithms, event-driven programming, and network programming.
• Supportive pedagogy – Displays all source code prominently within boxes, and includes "Word of Warning" features to highlight issues that commonly trip up beginning programmers. "For the Guru" boxes present deeper understanding in context for advanced students.
• Extensive end matter in each chapter – Includes a list of key points from the chapter, glossary of newly introduced terms, clearly marked Practice Problems with solutions, and extensive Exercises and Projects.
|1||Cornerstones of Computing||5|
|1.1||Data and Types||5|
|1.2||Operations, Functions, and Algorithms||6|
|1.3||High-Level Programming Languages||10|
|1.4||The Object-Oriented Paradigm||12|
|1.5||Design and Modeling||23|
|2||Getting Started in Python||31|
|2.1||The Python Interpreter||31|
|2.2||Using Objects: the list Class||32|
|2.3||Other Sequence Classes: str and tuple||49|
|2.4||Numeric Types: int, long, and float||58|
|2.9||Using a File for Source Code||69|
|2.10||Case Study: Strings and Lists||75|
|3||Getting Started with Graphics||89|
|3.3||Rotating, Scaling, and Flipping||103|
|3.5||Case Study: Smiley Face||106|
|3.8||Graphical User Interfaces||113|
|3.9||Case Study: Flying Arrows||116|
|4||Elementary Control Structures||125|
|4.2||Case Study: DNA to RNA Transcription||135|
|4.3||Case Study: Drawing a Pyramid||136|
|5||Additional Control Structures||159|
|5.3||Avoiding Duplicate Code||172|
|5.4||Case Study: Computing the Square Root||175|
|5.5||Error Checking and Exceptions||179|
|5.6||Case Study: Simulating a Chain under the Force of Gravity||185|
|6||Defining Our Own Classes||203|
|6.1||A Simple Point Class||203|
|6.2||A Robust Point Class||207|
|6.3||A Television Class||214|
|6.4||A Fraction Class||222|
|7||Good Software Practices||237|
|7.1||Overview of Mastermind||237|
|7.2||Top-Down Design and Bottom-Up Implementation||238|
|7.3||Our Mastermind Design||239|
|7.5||Formal Documentation: Python Docstrings||246|
|7.6||Encapsulation of Implementation Details||250|
|7.7||Modules and Unit Testing||252|
|7.9||Mastermind: Pulling It Together||260|
|7.10||Flexibility in Design: Graphical Output||263|
|8||Input, Output, and Files||271|
|8.1||Standard Input and Output||271|
|8.3||Working with Files||275|
|8.4||Handling Newline Characters||279|
|9.3||When Should Inheritance (Not) Be Used||308|
|9.4||Class Hierarchies and cs1graphics||310|
|9.6||Case Study: a Mailbox Class||321|
|10||Deeper Understanding of the Management of Objects||333|
|10.1||Understanding Objects and References||334|
|10.2||Objects that Reference Other Objects||341|
|10.3||Objects in the Context of a Function||348|
|10.4||Case Study: Subtleties in the cs1graphics Module||353|
|11.1||A Bullseye Class||362|
|11.2||Our Own List Implementation||368|
|11.5||Case Study: Solving a Puzzle||383|
|12||More Python Containers||397|
|12.1||Two Familiar Containers: list and tuple||399|
|12.3||Containers of Containers||406|
|12.6||Python's Internal Use of Dictionaries||416|
|12.7||Case Study: a Simple Search Engine||422|
|13||Implementing Data Structures||435|
|13.2||Python's list Class||438|
|13.3||Our Own Dictionary Implementation||441|
|13.4||Binary Search Trees||451|
|14.1||Customizing Use of Python's Sort||467|
|14.6||Which Algorithm Does Python Use?||487|
|15.1||Basics of Event-Driven Programming||494|
|15.2||Event Handling in Our Graphics Module||496|
|15.3||The Event Class||499|
|15.4||Programming Using Events||505|
|15.5||Case Study: a Full GUI for Mastermind||512|
|16.1||A Network Primer||521|
|16.2||Writing a Basic Client||524|
|16.3||Basic Network Servers||529|
|16.4||Case Study: Network Chat Room||532|
|16.5||Peer-to-Peer: Instant Messenger||540|
|16.6||Server-Side Scripting and CGI||543|
|16.7||Case Study: Searching the Web||546|
|A.1||Using the Python Interpreter within IDLE||561|
|A.2||Working with Files||562|
|B||Python, Java, and C++: a Transition Guide||565|
|B.1||The Purpose of This Guide||565|
|B.2||High-Level Programming Languages||566|
|B.3||A First Glance at Java and C++||569|
|C||Solutions to Practice Exercises||625|
Pearson offers affordable and accessible purchase options to meet the needs of your students. Connect with us to learn more.
K12 Educators: Contact your Savvas Learning Company Account General Manager for purchase options. Instant Access ISBNs are for individuals purchasing with credit cards or PayPal.
Savvas Learning Company is a trademark of Savvas Learning Company LLC.
Drs. Goldwasser and Letscher are on the Faculty in the Department of Mathematics and Computer Science at Saint Louis University. Both are active in teaching the introductory computer science course for which this book was designed. They have described the development of this material at the premier national and international conferences on Computer Science education. Dr. Goldwasser received his Ph.D. in Computer Science at Stanford University in 1997, and has taught courses at Stanford University, Princeton University, Loyola University of Chicago, and Colorado College before joining Saint Louis University. His research interests center around the design and analysis of algorithms. Dr. Letscher received his Ph.D. in Mathematics from the University of Michigan in 1997, and has taught courses in mathematics and computer science at the University of California San Diego, Oklahoma State University, and the American Institute of Mathematics before joining Saint Louis University. His primary research interests center around computational topology.
We're sorry! We don't recognize your username or password. Please try again.
The work is protected by local and international copyright laws and is provided solely for the use of instructors in teaching their courses and assessing student learning.
You have successfully signed out and will be required to sign back in should you need to download more resources.