Introduction 1
Part I: Start Programming Today
HOUR 1: Hands-On Programming 5
Get Ready to Program 5
What a Computer Program Does 6
Common Programming Misconceptions 7
Many Programs Already Exist 9
Programmers Are in Demand 9
The Real Value of Programs 9
Users Generally Don’t Own Programs 10
Giving Computers Programs 10
Your First Program 13
Clarifying Comments 14
Entering Your Own Program 16
Summary 18
Q&A 19
Workshop. 19
HOUR 2: Process and Techniques 21
Understanding the Need for Programs 21
Programs, Programs, Everywhere 24
Programs as Directions 25
Summary 35
Q&A 36
Workshop 36
HOUR 3: Designing a Program 39
The Need for Design 39
User-Programmer Agreement 40
Steps to Design 41
Summary 53
Q&A 53
Workshop 54
HOUR 4: Getting Input and Displaying Output 57
Printing to the Screen with JavaScript 57
Storing Data 59
Assigning Values 61
Getting Keyboard Data with Prompt 63
Summary 71
Q&A 72
Workshop. 72
HOUR 5: Data Processing with Numbers and Words 75
Strings Revisited 75
Performing Math with JavaScript 79
How Computers Really Do Math 83
Using the ASCII Table 86
Overview of Methods 87
Summary 92
Q&A 92
Workshop 92
HOUR 6: Controlling Your Programs 95
Comparing Data with if 95
Writing the Relational Test 98
Looping Statements 100
Summary 109
Q&A 109
Workshop 110
HOUR 7: Debugging Tools 113
The First Bug 113
Accuracy Is Everything 114
Write Clear Programs 119
Practice Debugging with JavaScript 120
JavaScript’s Console Log 125
Additional Debugging Techniques 126
Summary 127
Q&A 127
Workshop 128
Part II: Programming Fundamentals
HOUR 8: Structured Techniques 131
Structured Programming 131
Packaging Your JavaScript Code into Functions 137
Testing the Program 140
Profiling Code 142
Getting Back to Programming 142
Summary 143
Q&A 143
Workshop 143
HOUR 9: Programming Algorithms 145
Counters and Accumulators 146
Array Variables 149
Accumulators for Total 152
Swapping Values 154
Sorting 155
Searching Arrays 158
Taking Functions Further 165
Nested Loops 169
Summary 169
Q&A 169
Workshop 170
HOUR 10: Having Fun with Programming 173
Rotating Images on a Page 173
Capturing the Position of the Mouse 179
Adding a Repeating News Ticker to Your Website 180
Summary 183
Q&A 184
Workshop 184
HOUR 11: Advanced Programming 187
JavaScript’s Programming Weakness 187
Writing Cookies 190
Reading Cookies 192
Deleting Set Cookies 193
Summary 198
Q&A 198
Workshop 199
Part III: Object-Oriented Programming with Java
HOUR 12: Programming with Java 201
Introducing Java 202
Java Provides Executable Content 204
Seamless Execution 206
Multi-Platform Executable Content 206
Java Usage Summary 208
You’ll Start with Standalone Java 209
Java’s Interface 210
Security Issues 211
Give Java a Spin 212
Java Language Specifics 213
Get Ready to Begin 217
Summary 218
Q&A 218
Workshop 218
HOUR 13: Java’s Details 221
Defining Java Data 221
Operators 227
Programming Control 230
From Details to High-Level 235
Summary 236
Q&A 236
Workshop 236
HOUR 14: Java Has Class 239
Using NetBeans to Run a Java Program 239
Going GUI 244
Java and OOP 245
Overview of Classes 246
Do You Understand OOP? 248
Methods Do the Work in Classes 249
Summary 251
Q&A 252
Workshop 252
HOUR 15: Applets and Web Pages 255
About Writing Java Applets 255
Creating a Java Applet 256
Placing the Applet Inside the Web Page 262
Viewing the Applet Inside the Web Page 264
Summary 265
Q&A 266
Workshop. 266
Part IV: Other Programming Languages
HOUR 16: HTML5 and CSS3 269
HTML Programming 269
A Simpler Example 274
A Quick HTML Primer 275
Using CSS to Control How Your Text Looks 278
Including Graphics in Your Website with HTML 281
Summary 282
Q&A 282
Workshop 283
HOUR 17: JavaScript and AJAX 285
Introducing AJAX 285
Using XMLHttpRequest 289
Creating a Simple AJAX Library 291
Creating an AJAX Quiz Using the Library 292
Summary 297
Q&A 297
Workshop 298
HOUR 18: Scripting with PHP 301
What You Need for PHP Programming 302
Basic Structures in PHP Scripts 303
Looping 308
The Building Blocks of PHP: Variables, Data Types, and Operators 310
Using and Creating Functions in PHP 320
Working with Objects in PHP 324
Common Uses of PHP 328
Summary 329
Q&A 330
Workshop. 330
HOUR 19: Programming with C and C++ 333
Introducing C 333
What You Need for C and C++ Programming 335
Looking at C 335
C Data 337
C Functions 338
C Operators 345
C Control Statements Mimic JavaScript 345
Learning C++ 346
Object Terminology 346
Fundamental Differences Between C and C++ 347
Introducing C++ Objects 348
Things to Come 354
Summary 355
Q&A 356
Workshop 356
HOUR 20: Programming with Visual Basic 2012 359
Reviewing the Visual Basic Screen 359
Creating a Simple Application from Scratch 361
Other Visual Basic Programming Considerations 368
Your Next Step 371
Summary 371
Q&A 371
Workshop 372
HOUR 21: C# and the .NET Framework 375
Understanding the Purpose of .NET 375
The Common Language Runtime 376
The Framework Class Library 377
Parallel Computing Platform 378
Dynamic Language Runtime 378
The C# Language 378
Summary 387
Q&A 387
Workshop 388
Part V: The Business of Programming
HOUR 22: How Companies Program 389
Data Processing and Information Technology Departments 389
Computer-Related Jobs 393
Job Titles 394
Structured Walkthroughs 400
Putting a Program into Production 401
Consulting 403
Summary 404
Q&A 404
Workshop 404
HOUR 23: Distributing Applications 407
Issues Surrounding Software Distribution 407
Using Version Control 410
Summary 410
Q&A 410
Workshop. 411
HOUR 24: The Future of Programming 413
Some Helpful Tools 413
Will Programming Go Away? 416
Your Ongoing Training Needs 419
Summary 420
Q&A 421
Workshop 421
Index 423