0% found this document useful (0 votes)
33 views54 pages

(Ebook PDF) Visual C# How To Program 6Th Edition by Paul J. Deitel Download

The document is a promotional overview of various programming eBooks by Paul J. Deitel, including titles on Visual C#, C++, and Java. It provides links to download these eBooks and highlights the educational resources available through Deitel & Associates. The content also mentions the structure and topics covered in the Visual C# How to Program 6th Edition, emphasizing its relevance for learning programming concepts.

Uploaded by

rhodaborkebd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views54 pages

(Ebook PDF) Visual C# How To Program 6Th Edition by Paul J. Deitel Download

The document is a promotional overview of various programming eBooks by Paul J. Deitel, including titles on Visual C#, C++, and Java. It provides links to download these eBooks and highlights the educational resources available through Deitel & Associates. The content also mentions the structure and topics covered in the Visual C# How to Program 6th Edition, emphasizing its relevance for learning programming concepts.

Uploaded by

rhodaborkebd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

(eBook PDF) Visual C# How to Program 6th Edition

by Paul J. Deitel download

https://ebooksecure.com/product/ebook-pdf-visual-c-how-to-
program-6th-edition-by-paul-j-deitel/

Download full version ebook from https://ebooksecure.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebooksecure.com
to discover even more!

(eBook PDF) C++ How to Program 10th Edition by Paul J.


Deitel

http://ebooksecure.com/product/ebook-pdf-c-how-to-program-10th-
edition-by-paul-j-deitel/

C How to Program 9th Edition Deitel Paul - eBook PDF

https://ebooksecure.com/download/c-how-to-program-ebook-pdf/

(eBook PDF) C How to Program, Global Edition 8th by


Paul Deitel

http://ebooksecure.com/product/ebook-pdf-c-how-to-program-global-
edition-8th-by-paul-deitel/

C How to Program, 9th Global Edition Deitel Paul -


eBook PDF

https://ebooksecure.com/download/c-how-to-program-9th-global-
edition-ebook-pdf/
(eBook PDF) Java How to Program, Early Objects 11th
Edition by Paul J. Deitel

http://ebooksecure.com/product/ebook-pdf-java-how-to-program-
early-objects-11th-edition-by-paul-j-deitel/

C++ How to Program: An Objects-Natural Approach, 11e


11th Edition Paul Deitel - eBook PDF

https://ebooksecure.com/download/c-how-to-program-an-objects-
natural-approach-11e-ebook-pdf/

C How to Program: With Case Studies in Applications and


Systems Programming, Global Edition Paul Deitel - eBook
PDF

https://ebooksecure.com/download/c-how-to-program-with-case-
studies-in-applications-and-systems-programming-global-edition-
ebook-pdf/

C++ How to Program Early Objects Version 9th Edition


(eBook PDF)

http://ebooksecure.com/product/c-how-to-program-early-objects-
version-9th-edition-ebook-pdf/

(eBook PDF) Java How To Program (Early Objects) 10th

http://ebooksecure.com/product/ebook-pdf-java-how-to-program-
early-objects-10th/
Visual C#® HOW TO PROGRAM
SIXTH EDITION
Deitel® Series Page
How To Program Series
Android™ How to Program, 3/E

C++ How to Program, 10/E

C How to Program, 8/E

Java™ How to Program, Early Objects Version, 10/E

Java™ How to Program, Late Objects Version, 10/E

Internet & World Wide Web How to Program, 5/E

Visual Basic® 2012 How to Program, 6/E

Visual C#® How to Program, 6/E

Deitel® Developer Series


Android™ 6 for Programmers: An App-Driven Approach, 3/E

C for Programmers with an Introduction to C11

C++11 for Programmers

C# 6 for Programmers

iOS® 8 for Programmers: An App-Driven Approach with Swift™


Java™ for Programmers, 3/E

JavaScript for Programmers

Swift™ for Programmers

Simply Series
Simply Visual Basic® 2010: An App-Driven Approach, 4/E

Simply C++: An App-Driven Tutorial Approach

VitalSource Web Books


http://bit.ly/DeitelOnVitalSource

Android™ How to Program, 2/E and 3/E

C++ How to Program, 8/E and 9/E

Java™ How to Program, 9/E and 10/E

Simply C++: An App-Driven Tutorial Approach

Simply Visual Basic® 2010: An App-Driven Approach, 4/E

Visual Basic® 2012 How to Program, 6/E

Visual C#® 2012 How to Program, 5/E

Visual C#® How to Program, 6/E

LiveLessons Video Learning


Products
http://deitel.com/books/LiveLessons/

Android™ 6 App Development Fundamentals, 3/E

C++ Fundamentals

Java™ Fundamentals, 2/E

C# 6 Fundamentals

C# 2012 Fundamentals

iOS® 8 App Development Fundamentals with Swift™, 3/E

JavaScript Fundamentals

Swift™ Fundamentals

REVEL™ Interactive Multimedia


REVEL™ for Deitel Java™

To receive updates on Deitel publications, Resource Centers, training


courses, partner offers and more, please join the Deitel communities on

Facebook®—http://facebook.com/DeitelFan

Twitter®—http://twitter.com/deitel

LinkedIn®—http://linkedin.com/company/deitel-&-associates

YouTube™—http://youtube.com/DeitelTV

Google+™—http://google.com/+DeitelFan
and register for the free Deitel® Buzz Online e-mail newsletter at:

http://www.deitel.com/newsletter/subscribe.html

To communicate with the authors, send e-mail to:

[email protected]

For information on programming-languages corporate training seminars


offered by Deitel & Associates, Inc. worldwide, write to [email protected]
or visit:

http://www.deitel.com/training/

For continuing updates on Pearson/Deitel publications visit:

http://www.deitel.com
http://www.pearsonhighered.com/deitel/

Visit the Deitel Resource Centers, which will help you master programming
languages, software development, Android™ and iOS® app development, and
Internet- and web-related topics:

http://www.deitel.com/ResourceCenters.html
Visual C#® HOW TO PROGRAM
SIXTH EDITION

Paul Deitel

Harvey Deitel

Deitel & Associates, Inc.

Boston Columbus Hoboken Indianapolis New York San Francisco


Amsterdam Cape Town Dubai London Madrid Milan Munich Paris Montreal
Toronto Delhi Mexico City São Paulo Sydney Hong Kong Seoul Singapore
Taipei Tokyo
Vice President, Editorial Director: Marcia Horton
Acquisitions Editor: Tracy Johnson
Editorial Assistant: Kristy Alaura
VP of Marketing: Christy Lesko
Field Marketing Manager: Demetrius Hall
Marketing Assistant: Jon Bryant
Director of Product Management: Erin Gregg
Team Lead, Program and Project Management: Scott Disanno
Program Manager: Carole Snyder
Project Manager: Robert Engelhardt
Manufacturing Buyer, Higher Ed | RR Donnelley: Maura Zaldivar-Garcia
Cover Design: Paul Deitel, Harvey Deitel, Chuti Prasertsith
R&P Manager: Ben Ferrini
Inventory Manager: Ann Lam
Cover Photo Credit: © Kannanimages / Shutterstock

Credits and acknowledgments borrowed from other sources and reproduced,


with permission, in this textbook appear on page vi.

The authors and publisher of this book have used their best efforts in
preparing this book. These efforts include the development, research, and
testing of the theories and programs to determine their effectiveness. The
authors and publisher make no warranty of any kind, expressed or implied,
with regard to these programs or to the documentation contained in this book.
The authors and publisher shall not be liable in any event for incidental or
consequential damages in connection with, or arising out of, the furnishing,
performance, or use of these programs.

© 2017 Pearson Education, Inc. Hoboken, New Jersey 07030

All rights reserved. Printed in the United States of America. This publication
is protected by Copyright, and permission should be obtained from the
publisher prior to any prohibited reproduction, storage in a retrieval system,
or transmission in any form or by any means, electronic, mechanical,
photocopying, recording, or likewise. To obtain permission(s) to use material
from this work, please submit a written request to Pearson PLC, Permissions
Department, 330 Hudson St, New York, NY 10013.
Many of the designations by manufacturers and sellers to distinguish their
products are claimed as trademarks. Where those designations appear in this
book, and the publisher was aware of a trademark claim, the designations
have been printed in initial caps or all caps.

Microsoft and/or its respective suppliers make no representations about the


suitability of the information contained in the documents and related graphics
published as part of the services for any purpose. All such documents and
related graphics are provided “as is” without warranty of any kind. Microsoft
and/or its respective suppliers hereby disclaim all warranties and conditions
with regard to this information, including all warranties and conditions of
merchantability, whether express, implied or statutory, fitness for a particular
purpose, title and non-infringement. In no event shall Microsoft and/or its
respective suppliers be liable for any special, indirect or consequential
damages or any damages whatsoever resulting from loss of use, data or
profits, whether in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of information
available from the services. The documents and related graphics contained
herein could include technical inaccuracies or typographical errors. Changes
are periodically added to the information herein. Microsoft and/or its
respective suppliers may make improvements and/or changes in the
product(s) and/or the program(s) described herein at any time. Partial screen
shots may be viewed in full within the software version specified.

The documents and related graphics contained herein could include technical
inaccuracies or typographical errors. Changes are periodically added to the
information herein. Microsoft and/or its respective suppliers may make
improvements and/or changes in the product(s) and/or the program(s)
described herein at any time. Partial screen shots may be viewed in full
within the software version specified.

Library of Congress Cataloging-in-Publication Data on file.

10 9 8 7 6 5 4 3 2 1
ISBN-10: 0-13-460154-8

ISBN-13: 978-0-13-460154-0
In memory of William Siebert, Professor Emeritus of Electrical Engineering
and Computer Science at MIT:

Your use of visualization techniques in


your Signals and Systems lectures inspired
the way generations of engineers, computer
scientists, educators and authors present
their work.

Harvey and Paul Deitel


Trademarks
Deitel and the double-thumbs-up bug are registered trademarks of Deitel and
Associates, Inc.

Microsoft® Windows®, and Microsoft Visual C#® are registered trademarks


of the Microsoft Corporation in the U.S.A. And other countries. This book is
not sponsored or endorsed by or affiliated with the Microsoft Corporation.

UNIX is a registered trademark of The Open Group.

Throughout this book, trademarks are used. Rather than put a trademark
symbol in every occurrence of a trademarked name, we state that we are
using the names in an editorial fashion only and to the benefit of the
trademark owner, with no intention of infringement of the trademark.
Contents
1. Preface xxiii

2. Before You Begin xxxvii

1. 1 Introduction to Computers, the Internet and Visual C# 1

1. 1.1 Introduction 2

2. 1.2 Computers and the Internet in Industry and Research 2

3. 1.3 Hardware and Software 5

1. 1.3.1 Moore’s Law 5

2. 1.3.2 Computer Organization 6

4. 1.4 Data Hierarchy 7

5. 1.5 Machine Languages, Assembly Languages and High-Level


Languages 10

6. 1.6 Object Technology 11

7. 1.7 Internet and World Wide Web 13

8. 1.8 C# 15

1. 1.8.1 Object-Oriented Programming 16

2. 1.8.2 Event-Driven Programming 16

3. 1.8.3 Visual Programming 16

4. 1.8.4 An International Standard 16


5. 1.8.5 C# on Other Platforms 17

6. 1.8.6 Internet and Web Programming 17

7. 1.8.7 Asynchronous Programming with async and await 17

8. 1.8.8 Other Key Programming Languages 18

9. 1.9 Microsoft’s .NET 20

1. 1.9.1 .NET Framework 20

2. 1.9.2 Common Language Runtime 20

3. 1.9.3 Platform Independence 21

4. 1.9.4 Language Interoperability 21

10. 1.10 Microsoft’s Windows® Operating System 21

11. 1.11 Visual Studio Integrated Development Environment 23

12. 1.12 Painter Test-Drive in Visual Studio Community 23

2. 2 Introduction to Visual Studio and Visual Programming 33

1. 2.1 Introduction 34

2. 2.2 Overview of the Visual Studio Community 2015 IDE 34

1. 2.2.1 Introduction to Visual Studio Community 2015 34

2. 2.2.2 Visual Studio Themes 35

3. 2.2.3 Links on the Start Page 35

4. 2.2.4 Creating a New Project 36

5. 2.2.5 New Project Dialog and Project Templates 37


6. 2.2.6 Forms and Controls 38

3. 2.3 Menu Bar and Toolbar 39

4. 2.4 Navigating the Visual Studio IDE 42

1. 2.4.1 Solution Explorer 43

2. 2.4.2 Toolbox 44

3. 2.4.3 Properties Window 44

5. 2.5 Help Menu and Context-Sensitive Help 46

6. 2.6 Visual Programming: Creating a Simple App that Displays Text


and an Image 47

7. 2.7 Wrap-Up 56

8. 2.8 Web Resources 57

3. 3 Introduction to C# App Programming 65

1. 3.1 Introduction 66

2. 3.2 Simple App: Displaying a Line of Text 66

1. 3.2.1 Comments 67

2. 3.2.2 using Directive 68

3. 3.2.3 Blank Lines and Whitespace 69

4. 3.2.4 Class Declaration 69

5. 3.2.5 Main Method 71

6. 3.2.6 Displaying a Line of Text 71

7. 3.2.7 Matching Left ({) and Right (}) Braces 72


3. 3.3 Creating a Simple App in Visual Studio 72

1. 3.3.1 Creating the Console App 72

2. 3.3.2 Changing the Name of the App File 74

3. 3.3.3 Writing Code and Using IntelliSense 74

4. 3.3.4 Compiling and Running the App 76

5. 3.3.5 Errors, Error Messages and the Error List Window 77

4. 3.4 Modifying Your Simple C# App 77

1. 3.4.1 Displaying a Single Line of Text with Multiple


Statements 78

2. 3.4.2 Displaying Multiple Lines of Text with a Single


Statement 78

5. 3.5 String Interpolation 80

6. 3.6 Another C# App: Adding Integers 81

1. 3.6.1 Declaring the int Variable number1 82

2. 3.6.2 Declaring Variables number2 and sum 83

3. 3.6.3 Prompting the User for Input 83

4. 3.6.4 Reading a Value into Variable number1 83

5. 3.6.5 Prompting the User for Input and Reading a Value into
number2 84

6. 3.6.6 Summing number1 and number2 84

7. 3.6.7 Displaying the sum with string Interpolation 85


8. 3.6.8 Performing Calculations in Output Statements 85

7. 3.7 Memory Concepts 85

8. 3.8 Arithmetic 86

1. 3.8.1 Arithmetic Expressions in Straight-Line Form 87

2. 3.8.2 Parentheses for Grouping Subexpressions 87

3. 3.8.3 Rules of Operator Precedence 87

4. 3.8.4 Sample Algebraic and C# Expressions 88

5. 3.8.5 Redundant Parentheses 89

9. 3.9 Decision Making: Equality and Relational Operators 89

10. 3.10 Wrap-Up 94

4. 4 Introduction to Classes, Objects, Methods and strings 106

1. 4.1 Introduction 107

2. 4.2 Test-Driving an Account Class 108

1. 4.2.1 Instantiating an Object—Keyword new 108

2. 4.2.2 Calling Class Account’s GetName Method 109

3. 4.2.3 Inputting a Name from the User 109

4. 4.2.4 Calling Class Account’s SetName Method 110

3. 4.3 Account Class with an Instance Variable and Set and Get
Methods 110

1. 4.3.1 Account Class Declaration 110

2. 4.3.2 Keyword class and the Class Body 111


3. 4.3.3 Instance Variable name of Type string 111

4. 4.3.4 SetName Method 112

5. 4.3.5 GetName Method 114

6. 4.3.6 Access Modifiers private and public 114

7. 4.3.7 Account UML Class Diagram 115

4. 4.4 Creating, Compiling and Running a Visual C# Project with


Two Classes 116

5. 4.5 Software Engineering with Set and Get Methods 117

6. 4.6 Account Class with a Property Rather Than Set and Get
Methods 118

1. 4.6.1 Class AccountTest Using Account’s Name Property 118

2. 4.6.2 Account Class with an Instance Variable and a Property


120

3. 4.6.3 Account UML Class Diagram with a Property 122

7. 4.7 Auto-Implemented Properties 122

8. 4.8 Account Class: Initializing Objects with Constructors 123

1. 4.8.1 Declaring an Account Constructor for Custom Object


Initialization 123

2. 4.8.2 Class AccountTest: Initializing Account Objects When


They’re Created 124

9. 4.9 Account Class with a Balance; Processing Monetary Amounts


126

1. 4.9.1 Account Class with a decimal balance Instance


Variable 126

2. 4.9.2 AccountTest Class That Uses Account Objects with


Balances 129

10. 4.10 Wrap-Up 133

5. 5 Algorithm Development and Control Statements: Part 1 142

1. 5.1 Introduction 143

2. 5.2 Algorithms 144

3. 5.3 Pseudocode 144

4. 5.4 Control Structures 145

1. 5.4.1 Sequence Structure 145

2. 5.4.2 Selection Statements 146

3. 5.4.3 Iteration Statements 147

4. 5.4.4 Summary of Control Statements 147

5. 5.5 if Single-Selection Statement 147

6. 5.6 if…else Double-Selection Statement 148

1. 5.6.1 Nested if…else Statements 149

2. 5.6.2 Dangling-else Problem 151

3. 5.6.3 Blocks 151

4. 5.6.4 Conditional Operator (?:) 152

7. 5.7 Student Class: Nested if…else Statements 153

8. 5.8 while Iteration Statement 156


9. 5.9 Formulating Algorithms: Counter-Controlled Iteration 157

1. 5.9.1 Pseudocode Algorithm with Counter-Controlled Iteration


157

2. 5.9.2 Implementing Counter-Controlled Iteration 158

3. 5.9.3 Integer Division and Truncation 160

10. 5.10 Formulating Algorithms: Sentinel-Controlled Iteration 161

1. 5.10.1 Top-Down, Stepwise Refinement: The Top and First


Refinement 161

2. 5.10.2 Second Refinement 162

3. 5.10.3 Implementing Sentinel-Controlled Iteration 164

4. 5.10.4 Program Logic for Sentinel-Controlled Iteration 165

5. 5.10.5 Braces in a while Statement 166

6. 5.10.6 Converting Between Simple Types Explicitly and


Implicitly 166

7. 5.10.7 Formatting Floating-Point Numbers 167

11. 5.11 Formulating Algorithms: Nested Control Statements 168

1. 5.11.1 Problem Statement 168

2. 5.11.2 Top-Down, Stepwise Refinement: Pseudocode


Representation of the Top 169

3. 5.11.3 Top-Down, Stepwise Refinement: First Refinement 169

4. 5.11.4 Top-Down, Stepwise Refinement: Second Refinement


169
5. 5.11.5 Complete Second Refinement of the Pseudocode 170

6. 5.11.6 App That Implements the Pseudocode Algorithm 171

12. 5.12 Compound Assignment Operators 173

13. 5.13 Increment and Decrement Operators 173

1. 5.13.1 Prefix Increment vs. Postfix Increment 174

2. 5.13.2 Simplifying Increment Statements 175

3. 5.13.3 Operator Precedence and Associativity 176

14. 5.14 Simple Types 176

15. 5.15 Wrap-Up 177

6. 6 Control Statements: Part 2 192

1. 6.1 Introduction 193

2. 6.2 Essentials of Counter-Controlled Iteration 193

3. 6.3 for Iteration Statement 195

1. 6.3.1 A Closer Look at the for Statement’s Header 196

2. 6.3.2 General Format of a for Statement 196

3. 6.3.3 Scope of a for Statement’s Control Variable 196

4. 6.3.4 Expressions in a for Statement’s Header Are Optional


197

5. 6.3.5 Placing Arithmetic Expressions in a for Statement’s


Header 197

6. 6.3.6 Using a for Statement’s Control Variable in the


Statement’s Body 198

7. 6.3.7 UML Activity Diagram for the for Statement 198

4. 6.4 Examples Using the for Statement 198

5. 6.5 App: Summing Even Integers 199

6. 6.6 App: Compound-Interest Calculations 200

1. 6.6.1 Performing the Interest Calculations with Math Method


pow 201

2. 6.6.2 Formatting with Field Widths and Alignment 202

3. 6.6.3 Caution: Do Not Use float or double for Monetary


Amounts 203

7. 6.7 do…while Iteration Statement 204

8. 6.8 switch Multiple-Selection Statement 205

1. 6.8.1 Using a switch Statement to Count A, B, C, D and F


Grades 205

2. 6.8.2 switch Statement UML Activity Diagram 209

3. 6.8.3 Notes on the Expression in Each case of a switch 210

9. 6.9 Class AutoPolicy Case Study: strings in switch Statements


211

10. 6.10 break and continue Statements 213

1. 6.10.1 break Statement 213

2. 6.10.2 continue Statement 214

11. 6.11 Logical Operators 215


1. 6.11.1 Conditional AND (&&) Operator 216

2. 6.11.2 Conditional OR (||) Operator 216

3. 6.11.3 Short-Circuit Evaluation of Complex Conditions 217

4. 6.11.4 Boolean Logical AND (&) and Boolean Logical OR (|)


Operators 217

5. 6.11.5 Boolean Logical Exclusive OR (^) 218

6. 6.11.6 Logical Negation (!) Operator 218

7. 6.11.7 Logical Operators Example 219

12. 6.12 Structured-Programming Summary 221

13. 6.13 Wrap-Up 226

7. 7 Methods: A Deeper Look 237

1. 7.1 Introduction 238

2. 7.2 Packaging Code in C# 239

1. 7.2.1 Modularizing Programs 239

2. 7.2.2 Calling Methods 240

3. 7.3 static Methods, static Variables and Class Math 240

1. 7.3.1 Math Class Methods 241

2. 7.3.2 Math Class Constants PI and E 242

3. 7.3.3 Why Is Main Declared static? 242

4. 7.3.4 Additional Comments About Main 243

4. 7.4 Methods with Multiple Parameters 243


1. 7.4.1 Keyword static 245

2. 7.4.2 Method Maximum 245

3. 7.4.3 Assembling strings with Concatenation 245

4. 7.4.4 Breaking Apart Large string Literals 246

5. 7.4.5 When to Declare Variables as Fields 247

6. 7.4.6 Implementing Method Maximum by Reusing Method


Math.Max 247

5. 7.5 Notes on Using Methods 247

6. 7.6 Argument Promotion and Casting 248

1. 7.6.1 Promotion Rules 249

2. 7.6.2 Sometimes Explicit Casts Are Required 249

7. 7.7 The .NET Framework Class Library 250

8. 7.8 Case Study: Random-Number Generation 252

1. 7.8.1 Creating an Object of Type Random 252

2. 7.8.2 Generating a Random Integer 252

3. 7.8.3 Scaling the Random-Number Range 253

4. 7.8.4 Shifting Random-Number Range 253

5. 7.8.5 Combining Shifting and Scaling 253

6. 7.8.6 Rolling a Six-Sided Die 253

7. 7.8.7 Scaling and Shifting Random Numbers 256

8. 7.8.8 Repeatability for Testing and Debugging 257


Another Random Scribd Document
with Unrelated Content
THE SHRIMP-GIRL.

THE SHRIMP GIRL.

In this portrait from the life, first published in 1782, from the original
sketch in oil, are united the talents of Hogarth and Bartolozzi; but
the plate, which is executed in the dotted manner then so much in
fashion, should have been etched, or engraved, like those excellent
performances by Bartolozzi after the drawings of Guercino; as spirit,
rather than delicacy, is the characteristic of our artist's shrimp-girl.

LO R D H O L LA N D.
T H E R I G H T H O N . H E N RY F OX . LO R D H O L LA N D.

This is a serious portrait, from a drawing by Hogarth in 1757, of that


celebrated nobleman, whom he afterwards introduced in the second
plate of "The Times," as the powerful antagonist of Lord Bute.
The public life of this great statesman is too well known to need
recital here. Let it suffice to say, that in 1756 he resigned the office
of Secretary at War to Mr. Pitt; and in the following year was
appointed Paymaster of the Forces, which he retained until the
commencement of the reign of King George III. May 6, 1762, his
lady was created Baroness Holland; and April 16, 1763, he himself
was advanced to a peerage, by the title of Baron Holland of Foxley,
Wilts. In the latter part of his life he amused himself by building, at a
vast expense, a fantastic villa at Kingsgate, and died July 1, 1774, in
his 69th year.

E A R L O F C H A R L E M O N T.
T H E R I G H T H O N . JA M E S C AU L F I E L D. E A R L O F C H A R L E M O U N T.

James Caulfield, son of James Viscount Charlemont, was born


August 18, 1728; succeeded to his hereditary honours, April 21,
1734; and in December 1782, was raised to an earldom. He was
F.R.S., F.S.A., and LL.D.; and died August 4, 1799, aged 70.

T H E H O U S E O F C O M M O N S.
T H E H O U S E O F C O M M O N S.

This fine print exhibits an inside view of the House of Commons,


from an original painting taken in 1726 or 1727, and now in the
possession of the Earl of Onslow.
The prominent portraits are those of the Right Hon. Arthur
Onslow, the then Speaker; Sir Robert Walpole, the Prime Minister;
Sidney Godolphin, Esq., Father of the House; Colonel Onslow; Sir
James Thornhill; Sir Joseph Jekyll; Edward Stables, Esq., Clerk of the
House; Mr. Askew, Clerk-Assistant, and several others in the
background.

D E B AT E S O N PA L M I S T RY.

D E B AT E S O N PA L M I S T RY.

The figures employed in the study of palmistry seem to have been


designed for physicians and surgeons of an hospital, who are
debating on the most commodious method of receiving a fee,
inattentive to the complaints of a lame female who solicits
assistance. A spectre, resembling the royal Dane, comes out behind,
perhaps to intimate that physic and poison will occasionally produce
similar effects. A glass-case containing skeletons is open; a crocodile
hangs overhead; and an owl, emblematic of this sapient consistory,
is perched on a high stand.
Mr. Steevens conjectured that this might have been a repented
effort of hasty spleen against the officers of St. Bartholomew's, who
might not have treated some recommendation of a patient from our
artist with all the respect and attention to which he thought it was
entitled: but this is mere supposition.

T H E S TAY M A K E R .
T H E S TAY M A K E R .

The humour in this print is not very striking. The male staymaker
seems to be taking professional liberties with a female in the very
room where her husband sits, who is playing with one of his children
presented to him by a nurse, perhaps with a view to call off his
attention from what is going forward. The hag shows her pretended
love for the infant by the mode in which she is kissing him. A
maidservant holds a looking-glass for the lady, and peeps
significantly at the operator from behind it. A boy with a cockade on,
and a little sword by his side, appears to observe the familiarities
already mentioned, and is strutting up fiercely towards the
staymaker, while a girl is spilling some liquor in his hat.
C H A R I TY I N T H E C E L LA R .

C H A R I TY I N T H E C E L LA R .

The original picture from which this print was engraved, was painted
for the late Lord Boyne. It represents a convivial party assembled in
a cellar over a hogshead of claret, who, it is said, resolved not to
separate till they had drunk all the wine it contained. Whether such
a circumstance really gave rise to the picture or not, it is
unnecessary to inquire. It is too well known that the habit of
drinking to excess, among all classes of society, existed at the time
of Hogarth to such a degree as to draw the particular attention of
this distinguished painter to it; and it is not perhaps too much to say,
that the most distinguished preachers, or most able moral writers,
have not done more to drive this odious and degrading vice from
society than has been effected by the valuable pencil of Hogarth.
The individuals here represented were members of a society well
known by the name of the "Hell-fire Club." In the centre is the
portrait of Sir Philip Hoby, seated on the cask. Behind him, with his
hand held up, is that of Mr. De Grey, and below him is the portrait of
Lord J. Cavendish, who has drawn a spigot from the cask to let the
wine flow into a bowl. Opposite to him Lord Sandwich is represented
kneeling down to draw in the intoxicating draught; and behind him
(extended on a form) is also Lord Galway. The grouping of the four
centre figures is an ingenious imitation of a statue of Charity which
is seen in the cellar. The position of the bottles brings the
comparison still nearer, and is one of those little incidents for which
Hogarth was so particularly distinguished from all other painters, in
omitting nothing that might carry out his intention and make himself
understood.
The devotedness of this group to the object for which they are
assembled is extremely well portrayed. The positions of the figures
are easy, and the principle of observing the pyramidal form (so often
insisted upon as necessary to beauty in the grouping of figures) is
here strikingly exemplified. It is impossible to show a more
unconquerable love for the intoxicating draught than is expressed in
the portrait of Lord Galway. Unable to stand, he has placed himself
on his back in such a manner that the liquor from the cask above
him is flowing into his mouth; and he has perhaps been represented
by Hogarth as thus persevering in the fatal habit, in order to show
the excess to which it was then carried, and is a forcible point in the
painter's composition.
The picture is now in the possession of the present Lord Boyne,
and the print from it, which we have added to our present edition, is
not to be found in any other of the collected works of Hogarth.

S I X T I C K E TS.
S I X T I C K E TS.

The several designs collected in this plate require no particular


description. They are given as specimens of the facility with which
Hogarth descended to minor subjects, at the same time embellishing
them with strokes of his peculiar vein of pleasantry and humour; and
each of them sufficiently evinces the purpose it was intended to
recommend.
1. For the Mock Doctor. 2. For Pasquin. 3. For the Beggars' Opera.
4. For Joe Miller. 5. Thomas Figg, the noted prize-fighter. 6. The Ram
Inn at Cirencester.
NOTES.

he following hints are offered principally with a view to assist in identifying


such characters in Hogarth's prints as are unnoticed, or but slightly
described, in the preceding volumes. A key to the whole (for many of the
figures not yet recognised were undoubtedly meant by the artist as portraits)
would, to the other merits of these inimitable compositions, add the important one
of making them an assemblage of the similitudes of the leading remarkables of his
day.

S O U T H WA R K FA I R .
Vol. i. P. 162.
Although Hogarth, from a fear of creating himself enemies, disclaimed individual
portrait in his compositions, particularly of characters in the higher walks of life, he
was evidently not so scrupulous in indulging his satire when representing more
familiar scenes; and accordingly his "Harlot's Progress," "Four Times of the Day,"
"Industry and Idleness," "March to Finchley," etc., are found to be less peopled
with ideal personages than the "Marriage à la Mode," and some others.
"Southwark Fair" was an annual assemblage of remarkables, whose follies and
peculiarities he could hold up to the derision of the public without the danger of
retaliation; and he has availed himself of the opportunity by bringing together a
number of persons then well known on the town, and placing them in the most
ludicrous situations.
This Fair, the humours of which an ingenious author truly observes, "will never
be forgotten while Hogarth's inimitable print of it exists," was anciently called "Our
Lady Fair," and lasted fourteen days. Like most others in the kingdom, it was
originally established for the purposes of trade; but having become in process of
time a mere scene of low riot and debauchery, its duration was shortened to three
days; and it was at length totally abolished as a nuisance to the neighbourhood,
and an encouragement to vice and dissipation. It was held at the top of Blackman
Street, on the open space opposite the walls of the King's Bench prison, and
began yearly a fortnight after Bartholomew Tide.
The following characters in this print have been identified, in addition to others
before noticed: Middle group.—The person whom the bailiffs are arresting, and
who is supposed to have been playing (not Alexander the Great, but the part of
Paris) in the Siege of Troy (announced for representation on one of the
neighbouring show-cloths), was intended for Walker, afterwards the famous
Macheath in the Beggars' Opera, whose portrait it exactly resembles. It is
introduced in this place with strict propriety, as we learn that Walker kept a great
theatrical booth in Southwark Fair, as did Penkethman. "He also acted," says one
of his biographers, "in the same way at Bartholomew Fair, where Booth saw him
playing the part of Paris in the Siege of Troy."[121] The painter probably placed
him in the ridiculous situation we see him, on account of his known extravagancy
and consequent embarrassments, which often procured him a visit from the
bailiffs.
Figg, the prize-fighter, who in another part of the print is making his triumphal
entry on a blind horse, and brandishing his sword in defiance, was a native of
Thame in Oxfordshire, and attained so high a celebrity as a master of the "noble
science of defence," that we find him praised in the Tatler, Guardian, Craftsman,
and almost all the periodical works of the time. The mezzotinto portrait of him by
Faber represents him exactly as here—with a bald head and open collar. His own
school was in Oxford Road, but he was probably accustomed to exhibit his skill at
fairs, or he may be introduced here merely as a well-known character. The Bear
Garden, a famous place for prize-fighting, anciently stood in this neighbourhood,
and had then been but recently demolished. The manner of the combatants at this
place, parading the streets previous to their encounters, as described by a French
traveller in 1672, and the way in which Figg is represented, strictly agree.
"Commonly," says he, "when any fencing-masters belonging to the Bear Garden
are desirous of showing their courage and their great skill, they issue mutual
challenges; and before they engage, parade the town on horseback, with drums
and trumpets sounding, to inform the public there is a challenge between two
brave masters of the science of defence, and that the battle will be fought on such
a day." Figg's public challenges were the very acme of bombast. This extraordinary
character died in the year 1734.
Miller, the tall man, whose effigies are exhibited on a show-cloth, was a native
of Saxony, and probably came into England in the reign of George I. This gigantic
personage was eight feet high, the stature, within a few inches, of the late
O'Brien. He died in 1734, aged 60. Boitard engraved a portrait of him the year
before his death.
The two jugglers in senatorial wigs, who are displaying their magic wonders
with cups and balls, etc., seem to have been intended likewise for two real
characters (Fawkes and Neve), the Breslaw and Katterfelto of their day. Fawkes is
most certainly introduced in the print of "Burlington Gate," where, on a board, the
"Long Room" is announced, and "Fawkes' dexterity of hand." Portraits of these
worthies still exist, and bear a sufficient resemblance to identify them with their
representatives in the plate. Neve in a wood print prefixed to his "Merry
Companion, teaching tricks in legerdemain;" and Fawkes in a large sheet print by
Sutton Nichols, where he stands in the midst of his performances. Fawkes was no
indifferent wit. When Breslaw, a more modern performer of the same kind, was at
Canterbury, the former requested permission to display his cunning a little longer,
promising Mr. Mayor that if he was indulged with permission, he would give such a
night (naming a particular one) for the benefit of the poor. The benevolent
magistrate acceded to the proposition, and he had a crowded house. Hearing
nothing about the money collected on the specified evening, the Mayor waited on
the man of trick, and in a delicate way expressed his surprise. "Mr. Mayor, I have
distributed the money myself." Still more surprised, "Pray, Sir, to whom?" "To my
own company; none can be poorer." "This is a trick." "We live, Sir, by tricks."

M A R R I A G E A LA M O D E .
Vol. ii. P. 28.
Plate III.—The Procuress at the Quack's in this print is said to be designed for the
once celebrated Betty Careless, and the remark is countenanced by the initials "B.
C." on her bosom. This woman, by a very natural transition, from being one of the
most fashionable of the Cyprian corps, became lady abbess of a brothel; and, after
frequent arrests and imprisonments, was buried from the poorhouse of St. Paul's,
Covent Garden, April 22, 1752. Fielding, in his Amelia, says: "It is impossible to
conceive a greater appearance of modesty, innocence, and simplicity, than what
nature had displayed in the countenance of that girl,"—meaning her whom he in
another place calls "the inimitable Betsy Careless."
Ib. Plate IV.—A card on the floor in this print is inscribed:
"Count Basset desire to no how Lade Squander sleep last nite?"
A fashionable foreign adventurer, of the name of Count Basset, occurs as one of
the characters in the Provoked Husband, or a Journey to London, which might
have suggested the hint for this name. But, query, whether a real person? or the
artist might have meant to satirize the game of Basset.
N.B.—The set of prints of "Marriage à la Mode" is said to have furnished the idea
for the comedy of the Clandestine Marriage.

H A R LOT ' S P R O G R E SS.


Vol. i. Pp. 102-114.
Plate II.—The commentators on Hogarth do not seem to have assigned a
satisfactory reason for the particular subjects of the two paintings which ornament
the Harlot's apartment in this plate, viz. "David dancing before the Ark," and
"Jonah sitting under a Gourd." One supposes them merely intended to convey a
ridicule on the old masters, or placed here to satirize the impropriety of adorning
rooms with inappropriate subjects. Another, as stories selected at random, but
having a reference to the nation of the Harlot's Jew keeper. But as Hogarth's
incidents have all a meaning, a better reason must be sought for. They
undoubtedly conceal a moral applicable to the two principal figures in the print.
David's known breach of chastity in the affair of Uriah's wife, and "uncovering
himself" when dancing before the ark, "in the eyes of the handmaids of his
servants, as one of the vain fellows shamelessly uncovereth himself," which his
wife charges him with on that occasion, evidently typify the backsliding Jew; while
Jonah sitting under the shelter of his gourd, which sprang up in the night, and
which the worm destroyed in the morning, as ingeniously points out the girl's
upstart grandeur, and the frail nature of her protection, which even now a worm
(her infidelity to her keeper) is rapidly undermining.
Plate V.—Dr. Misaubin, or Mizenbank as Trusler calls him (the lean doctor in this
print), was a notorious foreign quack of the day, whose ignorant consequence
Fielding thus laughably exposes in one of his introductory chapters in Tom Jones:
—"The learned Dr. Misaubin used to say, that the proper direction to him was, 'To
Dr. Misaubin, in the world,' intimating that there were few people in it to whom his
great reputation was not known. And, perhaps, upon a nice examination into the
matter, we shall find that this circumstance bears no inconsiderable part among
the many blessings of human grandeur."
Watteau painted the portrait of this Esculapius, from which a print was engraved
by Pond. The likeness strikingly resembles Hogarth's representation, and is
inscribed "Prenez des pillules." The similitude of his opponent Dr. Rock, though not
authenticated in the same manner, is, from the testimony of those who recollect
him, equally correct.
This "great man" is said to have been originally a porter; for which his strong,
squat figure excellently adapted him. An anecdote, in some degree confirmed, is
told of him, that passing one day by the end of Fleet Market, with his gold-laced
hat and cane, a brother porter, who knew his origin, and was resting his load near
the spot, said, "Dr. Rock, you once carried a knot as well as myself." "Yes; and had
I been as great a dunce as you," replied the pill merchant, "I should have carried a
knot still."

R A K E ' S P R O G R E SS.
Vol. i. Pp. 132-154.
Plate III.—Tavern Scene.—In the second state of this plate, Pontac's head is
introduced in the place of a mutilated Cæsar. Pontac was a celebrated purveyor at
this time. In the "Hind and Panther" transversed, Pontac's eating-house is
mentioned with epicurean honours:
"When at Pontac's he may regale himself."
It was chiefly frequented as a chop-house, but every other luxury might be had
there.
Plate VIII.—The maniac chained to the floor of his cell in this print is noticed by
Mr. Ireland as being a copy from one of Cibber's figures over the gate of Bedlam.
He might have added, that the person of the Rake himself, whose expression of
madness Mr. Mortimer so much admired, is, as to features, a copy of the
companion figure over the same gate. This plagiarism, if it may be so called, was
to the credit of Hogarth's taste; for with all his own amazing powers of expression,
he could scarcely have hoped to equal such inimitable representations. Time, and
an injudicious attempt, some years since, at restoration, have wofully injured
these masterpieces of Cibber's chisel.
It may be observed of this print (the inside of Bedlam), in addition to what has
been before said, that the scene portrayed is not only a most faithful
representation of those doleful regions, but that most of the persons are certainly
intended as real portraits. One at least may, with every appearance of probability,
be added to the list of names of those already identified—the man sitting by the
figure inscribed "Charming Betty Careless," who is supposed to have gone mad for
love. Such a person was actually confined there for that malady some years
previous, whose history so exactly corresponds with Hogarth's representation, and
whom he must have remembered, that it can scarcely be doubted but he had him
in his eye. The portrait of the person alluded to is thus described in a modern
biographical work: "William Ellis. Printed and sold by Sutton Nichols, in Aldersgate
Street, Æt. 45, 1709." Sitting on the rails of Moorfields. Printed with his life and
character written by himself, etc. This poor maniac lost his reason through love for
his Betty, who seems to have been a real character. Ellis is represented with a
chaplet of laurel on his right, and a Cupid drawing his bow on the left. Under the
chaplet is inscribed—
"Tell her I burn with noble vestal fire,
Tell her she's all I wish or can desire."
And under the Cupid, amongst others, these lines:
"My years of minority I spent at school;
But love—that sweet passion—my reason would rule;
And yielding obedience to its potent sway,
The charming dear Betty my heart stole away.
Deny'd her enjoyment, at last I grew mad,
And nothing but Betty, dear Betty, I cry'd:
Such charms has that phœnix, she shall be my bride.
But Bedlam became my sad portion and lot,
By loving a fair one that knew of it not."
The eight paintings of "The Rake's Progress," which had been originally
purchased of Hogarth by Francis Beckford, Esq., for £88, 4s., were, at the sale of
William Beckford, Esq. of Fonthill, in 18—, sold by the elder Mr. Christie for the
sum of 850 guineas. The buyer was Colonel Fullarton, M.P.

IDLE AND INDUSTRIOUS APPRENTICE.


Vol. i. P. 284.
Plate VIII.—Speaking of the disposition of a crowd in a picture, Mr. Gilpin says:—"I
do not recollect having seen a crowd better managed than Hogarth has managed
one in the last print of his 'Idle 'Prentice.' In combining the multifarious company
which attends the spectacle of an execution, he hath exemplified all the
observations I have made. I have not the print before me, but I have often
admired it in this light; nor do I recollect observing anything offensive in it, which
is rare in the management of such a multitude of figures."—Observation on the
Wye, p. 123.

T H E T I M E S.
Vol. ii. P. 180.
The wild Indian painted on a show-cloth, with the inscription underneath, "Alive
from America," is meant as a satire on Alderman Beckford, for whose recent
uncourtly speech to Majesty (see the Guildhall Statue) the painter has represented
him as a savage.

F O U R T I M E S O F T H E D AY.
Vol. i. Pp. 222-226.
Plate II.—Noon.—The boy who has had the misfortune to break the baked
pudding, a commentator on Hogarth asserts was the late Mr. Henderson the
player, who often sportively assured his friends that he stood to Hogarth for the
sketch when he was with Fournier the drawing-master. But this is impossible, as
the prints in the receipt are promised to be delivered by Lady-day 1738, several
years before Henderson was born. A correspondent has assured us that he has
repeatedly heard his grandfather, an individual unknown to the public, refer to that
figure in the print as a portrait of himself, asserting that he had just such an
accident when a boy on the very spot, and was at that period remarkable for such
a head of hair (which was of a very light colour) as is shown in the print.
But query.—With more certainty we may venture to suggest, that the idea of the
woman throwing the shoulder of mutton out of the window is borrowed from the
old song:
"Now John he was no great eater, and Joan she was no great glutton,
So the better to pamper their stomachs, they bought them a shoulder of mutton:
But Joan in an angry mood took the shoulder of mutton in hand,
And out of the window she threw it,—poor John, he was at a stand," etc.
Plate III.—Evening.—The scene of this picture is laid at Islington, near Sadlers
Wells, which was then a famous place for tea-drinking, and the antitype for low
dissipation of the late "Dog and Duck." The view represents it correctly previous to
its being rebuilt in its present form, and exactly similar to a small copperplate
delineation of it over an old song, called "A Song in praise of Sadlers Wells," in
which its various amusements are described. The adjoining alehouse window, in
which we behold a group enveloped in their own smoke, is the "Sir Hugh
Middleton's Head," a sign still remaining. A celebrated knot of drinkers and
smokers actually met at this place about the period alluded to, at the head of
which was old Rosamond, the proprietor of the Wells; and it is not improbable but
that Hogarth might have known and meant to satirize this fraternity. The portraits
of these gentlemen are still preserved in a large painting at the very same public-
house, under the name of the "Sadlers Wells Club."

ENRAGED MUSICIAN.
Vol. i. P. 206.
Cervetto, well known by the name of "Nosee," has been generally supposed to be
intended by the character of the musician; but there are others who apply it to Dr.
Arne; for though not a strict likeness of that great composer, the figure and face
bear so near a resemblance (and he was extremely remarkable) as fully to
authorize the application. The known irritability of the Doctor in musical business
might not have been the only cause of Hogarth's placing him in this ludicrous
situation; his habits of intrigue, and singularly plain person, made him so fair an
object for caricature, that one of his portraits, printed with a song of his
composing, has ironically written under it, "Beauty and Virtue." This song, with the
portrait, was eagerly purchased up, and is now very scarce. Some years since Mr.
Colman got up a little interlude at the Haymarket Theatre from the idea of this
print, called "Ut Pictura Poesis, or the Enraged Musician," when the character of
the musician was purposely given to a performer who was thought in figure and
face to resemble Dr. Arne.

SIGISMUNDA.
Vol. i. P. 75.
This celebrated picture, which, at the time of first publishing the preceding
volumes, was in the possession of Messrs. Boydell & Co., but has since been in
other hands, was advertised to be sold by auction, with other effects, by Mr.
Jacques, May 12, 1812, on the premises, Great James Street, Bedford Row, and
was to be seen by applying for tickets for that purpose to the auctioneer.

THE BEGGARS' OPERA.


Vol. ii. P. 292.
In addition to the value of this print as a collection of portraits, it may be observed
that it contains the only known representation of the inside of the Lincoln's-Inn
Fields Theatre. This playhouse was opened under the management of Betterton,
with the comedy of Love for Love, which had a very considerable run. The
Beggars' Opera, however, was of still superior attraction, and it carried all before
it. After continuing open with various success for several seasons, the Lincoln's-Inn
Fields playhouse finally closed, on the removal of the company to the new theatre
in Covent Garden, and the building (the exterior of which is still entire) is now
occupied as Spode's pottery warehouse.

S L E E P Y C O N G R E G AT I O N .
Vol. i. P. 192.
The clergyman preaching is supposed to represent Dr. Desaguliers. But why
Hogarth has assigned him this post of honour, does not appear. This gentleman
was the son of a French Protestant clergyman; was educated at Cambridge, and
held the donative of Whitchurch, in Middlesex. He was the first lecturer on
experimental philosophy in the capital, and published his lectures in two vols. 4to.
He died at his lodgings at the Bedford Coffeehouse, Covent Garden, Feb. 29, 1744,
and was buried, March 26, at the Savoy. He is spoken of as a man of considerable
talents, but possibly might have had a peculiarly inanimate mode of delivering his
sermons, which occasioned Hogarth's satire. The original painting from which this
print was engraved was lately in the possession of the late John Follett, Esq., of
the Temple, London. It differs in some little particulars from the print.
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about testbank and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebooksecure.com

You might also like