The assignment is described in the attached picture.There are also some pictures, samples and material book for reference.The assignment is described in the attached picture.There are also some pictures, samples and material book for reference.Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
second Edition
Fundamentals of Python:
First Programs
Kenneth A. Lambert
Martin Osborne,
Contributing Author
Australia • Brazil • Mexico • Singapore • United Kingdom • United States
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
This is an electronic version of the print textbook. Due to electronic rights restrictions,
some third party content may be suppressed. Editorial review has deemed that any suppressed
content does not materially affect the overall learning experience. The publisher reserves the right
to remove content from this title at any time if subsequent rights restrictions require it. For
valuable information on pricing, previous editions, changes to current editions, and alternate
formats, please visit www.cengage.com/highered to search by ISBN#, author, title, or keyword for
materials in your areas of interest.
Important Notice: Media content referenced within the product description or the product
text may not be available in the eBook version.
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Fundamentals of Python:
First Programs, Second Edition
­Kenneth A. Lambert
SVP, GM Skills: Jonathan Lau
Product Team Manager: Kristin
McNary
Associate Product Manager: Kate
Mason
Executive Director of Development:
Marah Bellegarde
Senior Content Development
­Manager: Leigh Hefferon
© 2019, 2012 Cengage
ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may be reproduced or distributed in any form or by
any means, except as permitted by U.S. copyright law, without the
prior written permission of the copyright owner.
Unless otherwise noted all tables/figures exhibits are © 2019 ­Cengage®
For product information and technology assistance, contact us
at Cengage Customer & Sales Support, 1-800-354-9706
For permission to use material from this text or product, submit
all requests online at www.cengage.com/permissions.
Further permissions questions can be e-mailed to
permissionrequest@cengage.com
Content Development Manager: Jill
Gallagher
Senior Content Developer: Natalie
Pashoukos
Library of Congress Control Number: 2017952738
Softbound ISBN: 978-1-337-56009-2
Product Assistant: Jake Toth
Loose Leaf ISBN: 978-1-337-69934-1
Marketing Director: Michele McTighe
Cengage
20 Channel Center Street
Boston, MA, 02210
Marketing Manager: Stephanie
Albracht
Senior Content Project Manager:
Jennifer Feltri-George
Senior Designer/Art Director: Diana
Graham
USA
Cengage is a leading provider of customized learning solutions with
employees residing in nearly 40 different countries and sales in more
than 125 countries around the world. Find your local representative
at www.cengage.com.
Cover image: Digital_Art/­
Shutterstock.com
Cengage products are represented in Canada by Nelson Education, Ltd.
Production Service/Composition:
SPi Global
Purchase any of our products at your local college store or at our
­preferred online store www.cengagebrain.com.
To learn more about Cengage, visit www.cengage.com.
Notice to the Reader
Publisher does not warrant or guarantee any of the products described herein or perform any independent analysis
in connection with any of the product information contained herein. Publisher does not assume, and expressly
disclaims, any obligation to obtain and include information other than that provided to it by the manufacturer. The
reader is expressly warned to consider and adopt all safety precautions that might be indicated by the activities
described herein and to avoid all potential hazards. By following the instructions contained herein, the reader willingly
assumes all risks in connection with such instructions. The publisher makes no representations or warranties of any
kind, including but not limited to, the warranties of fitness for particular purpose or merchantability, nor are any
such representations implied with respect to the material set forth herein, and the publisher takes no responsibility
with respect to such material. The publisher shall not be liable for any special, consequential, or exemplary damages
resulting, in whole or part, from the readers’ use of, or reliance upon, this material.
Printed in the United States of America
Print Number: 01
Print Year: 2017
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Table of Contents
iii
Pref ace ������������������������������������������������ xiii
CHAPTER 1 I n t ro du ct io n ����������������������������������������������� 1
Two Fundamental Ideas of Computer Science: ­
Algorithms and Information Processing ������������������������������ 2
Algorithms ������������������������������������������������������������������� 2
Information Processing ��������������������������������������������������� 4
Exercises ������������������������������������������������������������������������ 5
The Structure of a Modern Computer System ������������������������ 6
Computer Hardware ������������������������������������������������������� 6
Computer Software ������������������������������������������������������� 7
Exercises ������������������������������������������������������������������������ 9
A Not-So-Brief History of Computing Systems ������������������������ 9
Before Electronic Digital Computers ��������������������������������11
The First Electronic Digital Computers (1940–1950) ���������13
The First Programming Languages (1950–1965) ��������������14
Integrated Circuits, Interaction,
and Timesharing (1965–1975) ��������������������������������������16
Personal Computing and Networks (1975–1990) ��������������17
Consultation, Communication,
and E-Commerce (1990–2000) ��������������������������������������19
Mobile Applications and Ubiquitous
Computing (2000–present) ������������������������������������������21
Getting Started with Python Programming ���������������������������22
Running Code in the Interactive Shell ������������������������������22
Input, Processing, and Output �����������������������������������������24
Editing, Saving, and Running a Script ������������������������������27
Behind the Scenes: How Python Works �����������������������������28
Exercises �����������������������������������������������������������������������29
Detecting and Correcting Syntax Errors ������������������������������29
Exercises �����������������������������������������������������������������������30
Suggestions for Further Reading ���������������������������������������30
Summary �����������������������������������������������������������������������31
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
contents
Review Questions ������������������������������������������������������������32
Projects ��������������������������������������������������������������������������33
CHAPTER 2 S o f t w are
D
­ evelo pment, Data Ty pes,
an d Expres s io n s ��������������������������������������� 34
iv
The Software Development Process �����������������������������������35
Exercises �����������������������������������������������������������������������37
Case Study: Income Tax Calculator ������������������������������������38
Strings, Assignment, and Comments �����������������������������������41
Data Types ������������������������������������������������������������������41
String Literals ��������������������������������������������������������������42
Escape Sequences ��������������������������������������������������������43
String Concatenation �����������������������������������������������������43
Variables and the Assignment Statement ��������������������������44
Program Comments and Docstrings ��������������������������������45
Exercises �����������������������������������������������������������������������46
Numeric Data Types and Character Sets �����������������������������47
Integers �����������������������������������������������������������������������47
Floating-Point Numbers ��������������������������������������������������47
Character Sets ������������������������������������������������������������48
Exercises �����������������������������������������������������������������������49
Expressions ��������������������������������������������������������������������49
Arithmetic Expressions ��������������������������������������������������50
Mixed-Mode Arithmetic and Type Conversions ��������������������52
Exercises �����������������������������������������������������������������������53
Using Functions and Modules ��������������������������������������������54
Calling Functions: Arguments and Return Values ���������������54
The math Module ���������������������������������������������������������55
The Main Module �����������������������������������������������������������56
Program Format and Structure ���������������������������������������57
Running a Script from a Terminal Command Prompt �����������57
Exercises �����������������������������������������������������������������������59
Summary �����������������������������������������������������������������������59
Review Questions ������������������������������������������������������������61
Projects ��������������������������������������������������������������������������62
CHAPTER 3
Lo o ps an d S elec ti on S tatements ������������������ 64
Definite Iteration: The for Loop �����������������������������������������65
Executing a Statement a Given Number of Times ��������������65
Count-Controlled Loops ��������������������������������������������������66
Augmented Assignment ��������������������������������������������������67
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
contents
Loop Errors: Off-by-One Error �����������������������������������������68
Traversing the Contents of a Data Sequence ��������������������68
Specifying the Steps in the Range �����������������������������������69
Loops That Count Down ������������������������������������������������69
Exercises �����������������������������������������������������������������������70
Formatting Text for Output ������������������������������������������������70
Exercises �����������������������������������������������������������������������72
Case Study: An Investment Report ��������������������������������������73
Selection: if and if-else Statements ������������������������������77
The Boolean Type, Comparisons, and Boolean
Expressions ���������������������������������������������������������������77
if-else Statements �����������������������������������������������������78
One-Way Selection Statements ���������������������������������������79
Multi-Way if Statements �����������������������������������������������80
Logical Operators and Compound Boolean Expressions �����82
Short-Circuit Evaluation ��������������������������������������������������84
Testing Selection Statements �����������������������������������������84
Exercises �����������������������������������������������������������������������85
Conditional Iteration: The while Loop ��������������������������������86
The Structure and Behavior of a while Loop ��������������������86
Count Control with a while Loop ������������������������������������87
The while True Loop and the break Statement ���������������88
Random Numbers ���������������������������������������������������������90
Loop Logic, Errors, and Testing ��������������������������������������91
Exercises �����������������������������������������������������������������������92
Case Study: Approximating Square Roots ���������������������������92
Summary �����������������������������������������������������������������������96
Review Questions ������������������������������������������������������������97
Projects ��������������������������������������������������������������������������99
CHAPTER 4 S t r in g s
v
an d Text Fi l es ����������������������������� 102
Accessing Characters and Substrings in Strings ���������������
The Structure of Strings ���������������������������������������������
The Subscript Operator �����������������������������������������������
Slicing for Substrings ������������������������������������������������
Testing for a Substring with the in Operator �����������������
Exercises ��������������������������������������������������������������������
Data Encryption �����������������������������������������������������������
Exercises ��������������������������������������������������������������������
Strings and Number Systems �����������������������������������������
The Positional System for Representing Numbers �����������
Converting Binary to Decimal ��������������������������������������
103
103
104
105
105
106
106
109
109
110
111
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
contents
Converting Decimal to Binary ��������������������������������������
Conversion Shortcuts ������������������������������������������������
Octal and Hexadecimal Numbers ���������������������������������
Exercises ��������������������������������������������������������������������
String Methods ������������������������������������������������������������
Exercises ��������������������������������������������������������������������
Text Files ��������������������������������������������������������������������
Text Files and Their Format �����������������������������������������
Writing Text to a File ��������������������������������������������������
Writing Numbers to a File ��������������������������������������������
Reading Text from a File ���������������������������������������������
Reading Numbers from a File ��������������������������������������
Accessing and Manipulating Files and Directories
on Disk ������������������������������������������������������������������
Exercises ��������������������������������������������������������������������
Case Study: Text Analysis �����������������������������������������������
Summary ��������������������������������������������������������������������
Review Questions ���������������������������������������������������������
Projects �����������������������������������������������������������������������
vi
CHAPTER 5
112
112
113
114
115
118
118
118
119
119
120
121
122
125
126
130
131
132
Lis t s an d Dict io nari es ����������������������������� 134
Lists ��������������������������������������������������������������������������
List Literals and Basic Operators ���������������������������������
Replacing an Element in a List ������������������������������������
List Methods for Inserting and Removing Elements ���������
Searching a List ��������������������������������������������������������
Sorting a List �����������������������������������������������������������
Mutator Methods and the Value None ���������������������������
Aliasing and Side Effects ��������������������������������������������
Equality: Object Identity and Structural
Equivalence ������������������������������������������������������������
Example: Using a List to Find the Median
of a Set of Numbers ������������������������������������������������
Tuples ���������������������������������������������������������������������
Exercises ��������������������������������������������������������������������
Defining Simple Functions ���������������������������������������������
The Syntax of Simple Function Definitions ���������������������
Parameters and Arguments �����������������������������������������
The return Statement �����������������������������������������������
Boolean Functions �����������������������������������������������������
Defining a main Function ��������������������������������������������
Exercises ��������������������������������������������������������������������
Case Study: Generating Sentences ���������������������������������
135
135
138
138
140
140
141
141
143
143
144
145
146
146
147
147
148
148
149
150
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
contents
Dictionaries �����������������������������������������������������������������
Dictionary Literals �����������������������������������������������������
Adding Keys and Replacing Values ��������������������������������
Accessing Values ������������������������������������������������������
Removing Keys ���������������������������������������������������������
Traversing a Dictionary �����������������������������������������������
Example: The Hexadecimal System Revisited �����������������
Example: Finding the Mode of a List of Values ���������������
Exercises ��������������������������������������������������������������������
Case Study: Nondirective Psychotherapy ��������������������������
Summary ��������������������������������������������������������������������
Review Questions ���������������������������������������������������������
Projects �����������������������������������������������������������������������
CHAPTER 6
153
153
154
154
155
155
156
157
158
159
163
164
165
vii
Des ig n w it h F u ncti ons ����������������������������� 167
A Quick Review of What Functions Are and How
They Work �����������������������������������������������������������������
Functions as Abstraction Mechanisms ��������������������������
Functions Eliminate Redundancy �����������������������������������
Functions Hide Complexity ������������������������������������������
Functions Support General Methods with Systematic
Variations ���������������������������������������������������������������
Functions Support the Division of Labor �����������������������
Exercises ��������������������������������������������������������������������
Problem Solving with Top-Down Design �����������������������������
The Design of the Text-Analysis Program �����������������������
The Design of the Sentence-Generator Program ��������������
The Design of the Doctor Program ��������������������������������
Exercises ��������������������������������������������������������������������
Design with Recursive Functions ��������������������������������������
Defining a Recursive Function ��������������������������������������
Tracing a Recursive Function ��������������������������������������
Using Recursive Definitions to Construct Recursive
Functions ���������������������������������������������������������������
Recursion in Sentence Structure �����������������������������������
Infinite Recursion ������������������������������������������������������
The Costs and Benefits of Recursion �����������������������������
Exercises ��������������������������������������������������������������������
Case Study: Gathering Information from a File System ��������
Managing a Program’s Namespace ���������������������������������
Module Variables, Parameters, and Temporary
Variables �����������������������������������������������������������������
Scope ���������������������������������������������������������������������
168
169
169
170
170
171
171
172
172
173
174
176
176
176
177
178
179
179
180
182
183
190
190
191
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
contents
viii
Lifetime ��������������������������������������������������������������������
Using Keywords for Default and Optional Arguments ��������
Exercises ��������������������������������������������������������������������
Higher-Order Functions ��������������������������������������������������
Functions as First-Class Data Objects ���������������������������
Mapping ��������������������������������������������������������������������
Filtering ��������������������������������������������������������������������
Reducing �����������������������������������������������������������������
Using lambda to Create Anonymous Functions ��������������
Creating Jump Tables ��������������������������������������������������
Exercises ��������������������������������������������������������������������
Summary ��������������������������������������������������������������������
Review Questions ���������������������������������������������������������
Projects �����������������������������������������������������������������������
CHAPTER 7 S im ple
192
193
194
195
195
196
197
197
198
199
199
200
202
203
Gr aph ics and Image Processi ng ������� 205
Simple Graphics �����������������������������������������������������������
Overview of Turtle Graphics �����������������������������������������
Turtle Operations ������������������������������������������������������
Setting Up a turtle.cfg File and Running IDLE �����������������
Object Instantiation and the turtle Module ������������������
Drawing Two-Dimensional Shapes ��������������������������������
Examining an Object’s Attributes ���������������������������������
Manipulating a Turtle’s Screen ��������������������������������������
Taking a Random Walk ����������������������������������������������
Colors and the RGB System �����������������������������������������
Example: Filling Radial Patterns with Random
Colors ��������������������������������������������������������������������
Exercises ��������������������������������������������������������������������
Case Study: Recursive Patterns in Fractals �����������������������
Image Processing ��������������������������������������������������������
Analog and Digital Information ��������������������������������������
Sampling and Digitizing Images �����������������������������������
Image File Formats �����������������������������������������������������
Image-Manipulation Operations ������������������������������������
The Properties of Images ��������������������������������������������
The images Module ���������������������������������������������������
A Loop Pattern for Traversing a Grid �����������������������������
A Word on Tuples ������������������������������������������������������
Converting an Image to Black and White �����������������������
Converting an Image to Grayscale ��������������������������������
Copying an Image �����������������������������������������������������
Blurring an Image ������������������������������������������������������
206
206
207
209
210
212
213
214
214
215
216
218
218
222
223
223
224
224
225
225
228
229
230
231
232
233
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
contents
Edge Detection ���������������������������������������������������������
Reducing the Image Size ��������������������������������������������
Exercises ��������������������������������������������������������������������
Summary ��������������������������������������������������������������������
Review Questions ���������������������������������������������������������
Projects �����������������������������������������������������������������������
CHAPTER 8 G r aph ical
234
235
237
237
238
240
ix
Us er Inter faces ������������������������� 244
The Behavior of Terminal-Based Programs and ­GUI-Based
Programs ������������������������������������������������������������������
The Terminal-Based Version �����������������������������������������
The GUI-Based Version �����������������������������������������������
Event-Driven Programming ������������������������������������������
Exercises ��������������������������������������������������������������������
Coding Simple GUI-Based Programs ��������������������������������
A Simple “Hello World” Program �����������������������������������
A Template for All GUI Programs �����������������������������������
The Syntax of Class and Method Definitions ������������������
Subclassing and Inheritance as Abstraction
Mechanisms �����������������������������������������������������������
Exercises ��������������������������������������������������������������������
Windows and Window Components �����������������������������������
Windows and Their Attributes ��������������������������������������
Window Layout �����������������������������������������������������������
Types of Window Components and Their Attributes ���������
Displaying Images �����������������������������������������������������
Exercises ��������������������������������������������������������������������
Command Buttons and Responding to Events ��������������������
Exercises ��������������������������������������������������������������������
Input and Output with Entry Fields �����������������������������������
Text Fields ���������������������������������������������������������������
Integer and Float Fields for Numeric Data ���������������������
Using Pop-Up Message Boxes ��������������������������������������
Exercises ��������������������������������������������������������������������
Defining and Using Instance Variables �����������������������������
Exercises ��������������������������������������������������������������������
Case Study: The Guessing Game Revisited �����������������������
Other Useful GUI Resources ��������������������������������������������
Using Nested Frames to Organize Components ��������������
Multi-Line Text Areas ��������������������������������������������������
File Dialogs ��������������������������������������������������������������
Obtaining Input with Prompter Boxes �����������������������������
Check Buttons �����������������������������������������������������������
245
246
246
248
249
249
249
251
251
252
253
253
253
254
256
257
259
260
262
262
262
264
265
267
267
269
269
273
273
275
277
280
281
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
contents
Radio Buttons �����������������������������������������������������������
Keyboard Events ��������������������������������������������������������
Working with Colors ���������������������������������������������������
Using a Color Chooser �����������������������������������������������
Summary ��������������������������������������������������������������������
Review Questions ���������������������������������������������������������
Projects �����������������������������������������������������������������������
x
CHAPTER 9
282
284
285
287
289
289
290
Des ig n w it h Clas ses �������������������������������� 293
Getting Inside Objects and Classes ��������������������������������� 294
A First Example: The Student Class ����������������������������� 295
Docstrings ��������������������������������������������������������������� 297
Method Definitions ����������������������������������������������������� 297
The __init __ Method and Instance Variables ����������������� 298
The __str __ Method �������������������������������������������������� 299
Accessors and Mutators ��������������������������������������������� 299
The Lifetime of Objects ����������������������������������������������� 299
Rules of Thumb for Defining a Simple Class ������������������ 300
Exercises �������������������������������������������������������������������� 301
Case Study: Playing the Game of Craps ��������������������������� 301
Data-Modeling Examples ������������������������������������������������ 309
Rational Numbers ������������������������������������������������������ 309
Rational Number Arithmetic and Operator Overloading ����� 311
Comparison Methods �������������������������������������������������� 312
Equality and the __eq__ Method ����������������������������������� 313
Savings Accounts and Class Variables �������������������������� 314
Putting the Accounts into a Bank ��������������������������������� 317
Using pickle for Permanent Storage of Objects ����������� 319
Input of Objects and the try-except Statement ����������� 320
Playing Cards ����������������������������������������������������������� 321
Exercises �������������������������������������������������������������������� 324
Case Study: An ATM ����������������������������������������������������� 324
Building a New Data Structure: The Two-Dimensional Grid �� 330
The Interface of the Grid Class ����������������������������������� 330
The Implementation of the Grid Class: Instance
Variables for the Data ����������������������������������������������� 332
The Implementation of the Grid Class: Subscript
and Search �������������������������������������������������������������� 333
Case Study: Data Encryption with a Block Cipher �������������� 333
Structuring Classes with Inheritance and Polymorphism ����� 337
Inheritance Hierarchies and Modeling ��������������������������� 338
Example 1: A Restricted Savings Account ��������������������� 339
Example 2: The Dealer and a Player in the Game
ofRights
Blackjack ������������������������������������������������������������
340
Copyright 2019 Cengage Learning. All
Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
contents
Polymorphic Methods �������������������������������������������������
The Costs and Benefits of Object-Oriented
Programming �����������������������������������������������������������
Exercises ��������������������������������������������������������������������
Summary ��������������������������������������������������������������������
Review Questions ���������������������������������������������������������
Projects �����������������������������������������������������������������������
344
345
346
347
348
349
xi
CHAPTER 10 M u lt it h readin g ,
­Networks, and Cl i ent/ Serv er
Pro g r am m in g ���������������������������������������� 352
Threads and Processes ��������������������������������������������������
Threads ��������������������������������������������������������������������
Sleeping Threads ������������������������������������������������������
Producer, Consumer, and Synchronization ��������������������
Exercises ��������������������������������������������������������������������
The Readers and Writers Problem �����������������������������������
Using the SharedCell Class ��������������������������������������
Implementing the Interface of the SharedCell Class �����
Implementing the Helper Methods of the
SharedCell Class ��������������������������������������������������
Testing the SharedCell Class with a Counter Object �����
Defining a Thread-Safe Class ��������������������������������������
Exercises ��������������������������������������������������������������������
Networks, Clients, and Servers ��������������������������������������
IP Addresses ������������������������������������������������������������
Ports, Servers, and Clients �����������������������������������������
Sockets and a Day/Time Client Script ��������������������������
A Day/Time Server Script ��������������������������������������������
A Two-Way Chat Script �����������������������������������������������
Handling Multiple Clients Concurrently ��������������������������
Exercises ��������������������������������������������������������������������
Case Study: Setting Up Conversations between Doctors
and Patients ��������������������������������������������������������������
Summary ��������������������������������������������������������������������
Review Questions ���������������������������������������������������������
Projects �����������������������������������������������������������������������
CHAPTER 11 S earch in g ,
353
354
357
358
364
364
365
366
368
369
370
371
371
372
373
373
375
377
378
380
381
386
387
388
­So r ti ng, and Compl ex i ty Anal y si s � 390
Measuring the Efficiency of Algorithms ����������������������������� 391
Measuring the Run Time of an Algorithm ����������������������� 391
Counting Instructions �������������������������������������������������� 394
Exercises
��������������������������������������������������������������������
396
Copyright 2019 Cengage Learning.
All Rights Reserved.
May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
contents
Complexity Analysis ������������������������������������������������������
Orders of Complexity ��������������������������������������������������
Big-O Notation �����������������������������������������������������������
The Role of the Constant of Proportionality ��������������������
Measuring the Memory Used by an Algorithm �����������������
Exercises ��������������������������������������������������������������������
Search Algorithms ��������������������������������������������������������
Search for a Minimum ������������������������������������������������
Sequential Search of a List �����������������������������������������
Best-Case, Worst-Case, and Average-Case
Performance �����������������������������������������������������������
Binary Search of a List �����������������������������������������������
Exercises ��������������������������������������������������������������������
Basic Sort Algorithms ���������������������������������������������������
Selection Sort �����������������������������������������������������������
Bubble Sort ��������������������������������������������������������������
Insertion Sort �����������������������������������������������������������
Best-Case, Worst-Case, and Average-Case
Performance Revisited ���������������������������������������������
Exercises ��������������������������������������������������������������������
Faster Sorting ��������������������������������������������������������������
Quicksort �����������������������������������������������������������������
Merge Sort ���������������������������������������������������������������
Exercises ��������������������������������������������������������������������
An Exponential Algorithm: Recursive Fibonacci �����������������
Converting Fibonacci to a Linear Algorithm �����������������������
Case Study: An Algorithm Profiler �����������������������������������
Summary ��������������������������������������������������������������������
Review Questions ���������������������������������������������������������
Projects �����������������������������������������������������������������������
xii
APP ENDIX A
397
397
399
400
400
401
401
401
402
403
403
405
405
406
407
408
410
410
411
411
415
418
419
420
421
427
428
429
Pyt h o n Res o u rce s ���������������������������������� 432
APP ENDIX B In s t allin g
t h e i mages
an d br ee zy py th ongui Li brari es �������������� 434
APP ENDIX C T h e
API f o r Im age Processi ng ������������������� 436
APP ENDIX D Tr an s it io n
f ro m Py thon to Jav a and C++ ����� 438
Glo s s ar y ���������������������������������������������� 439
In dex ���������������������������������������������������� 455
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface
xiii
“Everyone should learn how to code.” That’s my favorite quote from Suzanne Keen, the
Thomas Broadus Professor of English and Dean of the College at Washington and Lee University, where I have taught computer science for more than 30 years. The quote also states
the reason why I wrote the first edition of Fundamentals of Python: First Programs, and why
I now offer you this second edition. The book is intended for an introductory course in programming and problem solving. It covers the material taught in a typical Computer Science 1
course (CS1) at the undergraduate or high school level.
This book covers five major aspects of computing:
1.
Programming Basics—Data types, control structures, algorithm development, and
program design with functions are basic ideas that you need to master in order to
solve problems with computers. This book examines these core topics in detail and
gives you practice employing your understanding of them to solve a wide range of
problems.
2.
Object-Oriented Programming (OOP)—Object-oriented programming is the
dominant programming paradigm used to develop large software systems. This
book introduces you to the fundamental principles of OOP and enables you to
apply them successfully.
3.
Data and Information Processing—Most useful programs rely on data structures
to solve problems. These data structures include strings, arrays, files, lists, and dictionaries. This book introduces you to these commonly used data structures and
includes examples that illustrate criteria for selecting the appropriate data structures for given problems.
4.
Software Development Life Cycle—Rather than isolate software development
techniques in one or two chapters, this book deals with them throughout in the
context of numerous case studies. Among other things, you’ll learn that coding a
program is often not the most difficult or challenging aspect of problem solving
and software development.
5.
Contemporary Applications of Computing—The best way to learn about programming and problem solving is to create interesting programs with real-world
applications. In this book, you’ll begin by creating applications that involve numerical problems and text processing. For example, you’ll learn the basics of encryption
techniques such as those that are used to make your credit card number and other
information secure on the Internet. But unlike many other introductory texts, this
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
P r e f a c e
Why Python?
one does not restrict itself to problems involving numbers and text. Most contemporary applications involve graphical user interfaces, event-driven programming,
graphics, image manipulation, and network communications. These topics are not
consigned to the margins, but are presented in depth after you have mastered the
basics of programming.
xiv
Why Python?
Computer technology and applications have become increasingly more sophisticated over
the past three decades, and so has the computer science curriculum, especially at the introductory level. Today’s students learn a bit of programming and problem solving, and they
are then expected to move quickly into topics like software development, complexity analysis, and data structures that, 30 years ago, were relegated to advanced courses. In addition,
the ascent of object-oriented programming as the dominant paradigm of problem solving
has led instructors and textbook authors to implant powerful, industrial-strength programming languages such as C++ and Java in the introductory curriculum. As a result, instead
of experiencing the rewards and excitement of solving problems with computers, beginning
computer science students often become overwhelmed by the combined tasks of mastering
advanced concepts as well as the syntax of a programming language.
This book uses the Python programming language as a way of making the first year of
studying computer science more manageable and attractive for students and instructors
alike. Python has the following pedagogical benefits:
•• Python has simple, conventional syntax. Python statements are very close to those of
pseudocode algorithms, and Python expressions use the conventional notation found in
algebra. Thus, students can spend less time learning the syntax of a programming language and more time learning to solve interesting problems.
•• Python has safe semantics. Any expression or statement whose meaning violates the
definition of the language produces an error message.
•• Python scales well. It is very easy for beginners to write simple programs in Python.
Python also includes all of the advanced features of a modern programming language,
such as support for data structures and object-oriented software development, for use
when they become necessary.
•• Python is highly interactive. Expressions and statements can be entered at an interpreter’s prompts to allow the programmer to try out experimental code and receive immediate feedback. Longer code segments can then be composed and saved in script files to
be loaded and run as modules or standalone applications.
•• Python is general purpose. In today’s context, this means that the language includes
resources for contemporary applications, including media computing and networks.
•• Python is free and is in widespread use in industry. Students can download Python to
run on a variety of devices. There is a large Python user community, and expertise in
Python programming has great résumé value.
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Organization of the Book
pr e f a c e
To summarize these benefits, Python is a comfortable and flexible vehicle for expressing
ideas about computation, both for beginners and for experts. If students learn these ideas
well in the first course, they should have no problems making a quick transition to other
languages needed for courses later in the curriculum. Most importantly, beginning students
will spend less time staring at a computer screen and more time thinking about interesting
problems to solve.
xv
Organization of the Book
The approach of this text is easygoing, with each new concept introduced only when it is
needed.
Chapter 1 introduces computer science by focusing on two fundamental ideas, algorithms
and information processing. A brief overview of computer hardware and software, followed
by an extended discussion of the history of computing, sets the context for computational
problem solving.
Chapters 2 and 3 cover the basics of problem solving and algorithm development using the
standard control structures of expression evaluation, sequencing, Boolean logic, selection,
and iteration with the basic numeric data types. Emphasis in these chapters is on problem
solving that is both systematic and experimental, involving algorithm design, testing, and
documentation.
Chapters 4 and 5 introduce the use of the strings, text files, lists, and dictionaries. These
data structures are both remarkably easy to manipulate in Python and support some interesting applications. Chapter 5 also introduces simple function definitions as a way of organizing algorithmic code.
Chapter 6 explores the technique and benefits of procedural abstraction with function
definitions. Top-down design, stepwise refinement, and recursive design with functions are
examined as means of structuring code to solve complex problems. Details of namespace
organization (parameters, temporary variables, and module variables) and communication among software components are discussed. A section on functional programming
with higher-order functions shows how to exploit functional design patterns to simplify
solutions.
Chapter 7 focuses on the use of existing objects and classes to compose programs. ­Special
attention is paid to the application programming interface (API), or set of methods, of
a class of objects and the manner in which objects cooperate to solve problems. This
­chapter also introduces two contemporary applications of computing, graphics and
image ­processing—areas in which object-based programming is particularly useful.
Chapter 8 introduces the definition of new classes to construct graphical user interfaces
(GUIs). The chapter contrasts the event-driven model of GUI programs with the processdriven model of terminal-based programs. The creation and layout of GUI components
are explored, as well as the design of GUI-based applications using the model/view pattern.
The initial approach to defining new classes in this chapter is unusual for an introductory
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
P r e f a c e
Special Features
textbook: students learn that the easiest way to define a new class is to customize an existing class using subclassing and inheritance.
xvi
Chapter 9 continues the exploration of object-oriented design with the definition of entirely
new classes. Several examples of simple class definitions from different application domains
are presented. Some of these are then integrated into more realistic applications, to show
how object-oriented software components can be used to build complex systems. Emphasis
is on designing appropriate interfaces for classes that exploit polymorphism.
Chapter 10 covers advanced material related to several important areas of computing:
concurrent programming, networks, and client/server applications. This chapter thus
gives students challenging experiences near the end of the first course. Chapter 10 introduces multithreaded programs and the construction of simple network-based client/server
applications.
Chapter 11 covers some topics addressed at the beginning of a traditional CS2 course. This
chapter introduces complexity analysis with big-O notation. Enough material is presented
to enable you to perform simple analyses of the running time and memory usage of algorithms and data structures, using search and sort algorithms as examples.
Special Features
This book explains and develops concepts carefully, using frequent examples and diagrams.
New concepts are then applied in complete programs to show how they aid in solving problems. The chapters place an early and consistent emphasis on good writing habits and neat,
readable documentation.
The book includes several other important features:
•• Case studies—These present complete Python programs ranging from the simple to
the substantial. To emphasize the importance and usefulness of the software development life cycle, case studies are discussed in the framework of a user request, followed
by analysis, design, implementation, and suggestions for testing, with well-defined tasks
performed at each stage. Some case studies are extended in end-of-chapter programming projects.
•• Chapter objectives and chapter summaries—Each chapter begins with a set of learning
objectives and ends with a summary of the major concepts covered in the chapter.
•• Key terms and a glossary—When a technical term is introduced in the text, it appears in
boldface. Definitions of the key terms are also collected in a glossary.
•• Exercises—Most major sections of each chapter end with exercise questions that reinforce the reading by asking basic questions about the material in the section. Each chapter ends with a set of review exercises.
•• Programming projects—Each chapter ends with a set of programming projects of varying difficulty.
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Instructor Resources
pr e f a c e
•• A software toolkit for image processing—This book comes with an open-source
Python toolkit for the easy image processing discussed in Chapter 7. The toolkit can be
obtained from the student downloads page on www.cengage.com, or at http://home.wlu
.edu/~lambertk/python/
•• A software toolkit for GUI programming—This book comes with an open-source
Python toolkit for the easy GUI programming introduced in Chapter 8. The toolkit can
be obtained from the student downloads page on www.cengage.com, or at http://home
.wlu.edu/~lambertk/breezypythongui/
xvii
•• Appendices—Four appendices include information on obtaining Python resources,
installing the toolkits, and using the toolkits’ interfaces.
New in This Edition
The most obvious change in this edition is the addition of full color. All program examples
include the color coding used in Python’s IDLE, so students can easily identify program
elements such as keywords, program comments, and function, method, and class names.
Several new figures have been added to illustrate concepts, and many exercises and programming projects have been reworked. The brief history of computing in Chapter 1 has
been brought up to date. A discussion of a Grid type has been included to give students
exposure to a two-dimensional data structure. The book remains the only introductory
Python text with a thorough introduction to realistic GUI programming. The chapter
on GUIs (Chapter 8) now uses the breezypythongui toolkit to ease the introduction of
this topic. The chapter on GUIs has also been placed ahead of the chapter on design with
classes (Chapter 9). This arrangement allows students to explore the customizing of existing classes with GUI programming before they tackle the design of entirely new classes in
the following chapter. Finally, a new section on the readers and writers problem has been
added to Chapter 10, to illustrate thread-safe access to shared resources.
Instructor Resources
MindTap
MindTap activities for Fundamentals of Python: First Programs are designed to help students master the skills they need in today’s workforce. Research shows employers need
critical thinkers, troubleshooters, and creative problem-solvers to stay relevant in our
fast-paced, technology-driven world. MindTap helps you achieve this with assignments
and activities that provide hands-on practice and real-life relevance. Students are guided
through assignments that help them master basic knowledge and understanding before
moving on to more challenging problems.
All MindTap activities and assignments are tied to defined unit learning objectives.
­Hands-on coding labs provide real-life application and practice. Readings and dynamic
visualizations support the lecture, while a post-course assessment measures exactly how
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
P r e f a c e
We Appreciate Your Feedback
much a student has learned. MindTap provides the analytics and reporting to easily see
where the class stands in terms of progress, engagement, and completion rates. Use the
content and learning path as-is or pick-and-choose how our materials will wrap around
yours. You control what the students see and when they see it. Learn more at http://www
.cengage.com/mindtap/.
xviii
Instructor Companion Site
The following teaching tools are available for download at the Companion Site for this text.
Simply search for this text at www.cengagebrain.com and choose “Instructor Downloads.”
An instructor login is required.
•• Instructor’s Manual: The Instructor’s Manual that accompanies this textbook includes
additional instructional material to assist in class preparation, including items such as
Overviews, Chapter Objectives, Teaching Tips, Quick Quizzes, Class Discussion Topics, Additional Projects, Additional Resources, and Key Terms. A sample syllabus is also
available.
•• Test Bank: Cengage Testing Powered by Cognero is a flexible, online system that allows
you to:
•• author, edit, and manage test bank content from multiple Cengage solutions
•• create multiple test versions in an instant
•• deliver tests from your LMS, your classroom, or wherever you want
•• PowerPoint Presentations: This text provides PowerPoint slides to accompany each
chapter. Slides may be used to guide classroom presentations, to make available to students for chapter review, or to print as classroom handouts. Files are provided for every
figure in the text. Instructors may use the files to customize PowerPoint slides, illustrate
quizzes, or create handouts.
•• Solutions: Solutions to all programming exercises are available. If an input file is
needed to run a programming exercise, it is included with the solution file.
•• Source Code: The source code is available at www.cengagebrain.com. If an input file is
needed to run a program, it is included with the source code.
We Appreciate Your Feedback
We have tried to produce a high-quality text, but should you encounter any errors,
please report them to lambertk@wlu.edu or http://support.cengage.com. A list of errata,
should they be found, as well as other information about the book, will be posted on
the Web site http://home.wlu.edu/~lambertk/python/ and with the student resources at
www.cengagebrain.com.
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Dedication
pr e f a c e
Acknowledgments
I would like to thank my contributing author, Martin Osborne, for many years of advice,
friendly criticism, and encouragement on several of my book projects. I am also grateful
to the many students and colleagues at Washington and Lee University who have used this
book and given helpful feedback on it over the life of the first edition.
In addition, I would like to thank the following reviewers for the time and effort they
contributed to Fundamentals of Python: Steven Robinett, Great Falls College Montana
State University; Mark Williams, University of Maryland Eastern Shore; Andrew ­Danner,
­Swarthmore College; Susan Fox, Macalester College; Emily Shepard, Central Carolina
Community College.
xix
Also, thank you to the individuals at Cengage who helped to assure that the content of
all data and solution files used for this text were correct and accurate: John Freitas, MQA
­Project Leader, and Danielle Shaw, MQA Tester.
Finally, thanks to several other people whose work made this book possible: Kate Mason,
Associate Product Manager, Cengage; Natalie Pashoukos, Senior Content Developer,
­Cengage; and Jennifer Feltri-George, Senior Content Project Manager, Cengage. I also
want to thank Scarlett Lindsay for her superb copyediting of the book and Chandrasekar
­Subramanian for an excellent job managing the paging of the project.
Dedication
To my good friends, Lesley and David Novack
Kenneth A. Lambert
Lexington, VA
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Chapter
Introduction
1
After completing this chapter, you will be able to
Describe the basic features of an algorithm
Explain how hardware and software collaborate in
a ­computer’s architecture
Summarize a brief history of computing
Compose and run a simple Python program
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203
Copyright 2019 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Chapter 1
2
Introduction
As a reader of this book, you almost certainly have played a video game and listened to
digital music. It’s likely that you have watched a digital movie after preparing a snack in a
microwave oven. Chances are that today you will make a phone call, send or receive a text
message, take a photo, or consult your favorite social network on a cell phone. You and your
friends have most likely used a desktop computer or a laptop computer to do some significant coursework in h…
Purchase answer to see full
attachment




Why Choose Us

  • 100% non-plagiarized Papers
  • 24/7 /365 Service Available
  • Affordable Prices
  • Any Paper, Urgency, and Subject
  • Will complete your papers in 6 hours
  • On-time Delivery
  • Money-back and Privacy guarantees
  • Unlimited Amendments upon request
  • Satisfaction guarantee

How it Works

  • Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
  • Fill in your paper’s requirements in the "PAPER DETAILS" section.
  • Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
  • Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
  • From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.