Introduction |
|
xvi | |
Part 1: Programming fundamentals |
|
|
|
2 | (16) |
|
|
4 | (1) |
|
Getting the tools and demos |
|
|
4 | (1) |
|
|
5 | (10) |
|
Visual Studio projects and solutions |
|
|
6 | (1) |
|
Running a program with Visual Studio |
|
|
7 | (3) |
|
Stopping a program running in Visual Studio |
|
|
10 | (1) |
|
The MyProgram application |
|
|
11 | (4) |
|
|
15 | (3) |
|
|
18 | (24) |
|
|
20 | (3) |
|
Programming and party planning |
|
|
20 | (1) |
|
|
21 | (1) |
|
|
22 | (1) |
|
Computers as data processors |
|
|
23 | (12) |
|
Machines and computers and us |
|
|
23 | (3) |
|
|
26 | (1) |
|
Programs as data processors |
|
|
27 | (8) |
|
|
35 | (4) |
|
|
39 | (3) |
|
|
42 | (26) |
|
|
44 | (6) |
|
|
44 | (1) |
|
|
45 | (1) |
|
Declare the StartProgram method |
|
|
46 | (1) |
|
Set the title and display a message |
|
|
47 | (3) |
|
|
50 | (2) |
|
|
50 | (2) |
|
Creating new program files |
|
|
52 | (9) |
|
|
61 | (2) |
|
|
61 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
63 | (1) |
|
|
63 | (3) |
|
|
66 | (2) |
|
4 Working with data in a program |
|
|
68 | (32) |
|
|
70 | (4) |
|
Variables and computer storage |
|
|
71 | (1) |
|
|
71 | (2) |
|
Simple assignment statements |
|
|
73 | (1) |
|
Using a variable in a program |
|
|
74 | (6) |
|
Assigning values in a declaration |
|
|
76 | (1) |
|
|
77 | (3) |
|
|
80 | (5) |
|
Whole numbers and real numbers |
|
|
80 | (3) |
|
|
83 | (2) |
|
Working with different types of data |
|
|
85 | (4) |
|
Converting numbers into text |
|
|
86 | (3) |
|
Whole numbers and real numbers in programs |
|
|
89 | (6) |
|
Variable types and expressions |
|
|
89 | (2) |
|
|
91 | (1) |
|
Converting types by casting |
|
|
92 | (1) |
|
Using casting on operands in an expression |
|
|
93 | (1) |
|
|
94 | (1) |
|
|
95 | (2) |
|
|
95 | (1) |
|
|
96 | (1) |
|
|
97 | (3) |
|
5 Making decisions in a program |
|
|
100 | (34) |
|
Understanding the Boolean type |
|
|
102 | (2) |
|
Declaring a Boolean variable |
|
|
102 | (1) |
|
|
103 | (1) |
|
Using if constructions and operators |
|
|
104 | (6) |
|
|
106 | (1) |
|
|
107 | (2) |
|
|
109 | (1) |
|
Creating blocks of statements |
|
|
110 | (3) |
|
Local variables in blocks of code |
|
|
111 | (2) |
|
Creating complex conditions using logical operators |
|
|
113 | (4) |
|
|
116 | (1) |
|
Adding comments to make a program clearer |
|
|
117 | (2) |
|
Funfair rides and programs |
|
|
119 | (8) |
|
|
122 | (2) |
|
Building logic using if conditions |
|
|
124 | (1) |
|
|
125 | (2) |
|
Working with program assets |
|
|
127 | (5) |
|
Asset management in Visual Studio |
|
|
127 | (1) |
|
|
128 | (1) |
|
|
129 | (3) |
|
|
132 | (2) |
|
6 Repeating actions with loops |
|
|
134 | (38) |
|
Using a loop to make a pizza picker |
|
|
136 | (13) |
|
|
136 | (3) |
|
|
139 | (1) |
|
|
139 | (3) |
|
|
142 | (7) |
|
Performing input validation with a while loop |
|
|
149 | (2) |
|
Using Visual Studio to follow the execution of your programs |
|
|
151 | (6) |
|
Counting in a loop to make a times-table tutor |
|
|
157 | (3) |
|
Using a for loop construction |
|
|
160 | (3) |
|
|
163 | (2) |
|
Going back to the top of a loop by using continue |
|
|
165 | (3) |
|
|
168 | (2) |
|
|
168 | (1) |
|
|
169 | (1) |
|
|
170 | (2) |
|
|
172 | (40) |
|
|
174 | (2) |
|
Storing the data in single variables |
|
|
175 | (1) |
|
|
176 | (23) |
|
|
177 | (2) |
|
|
179 | (5) |
|
Displaying the contents of the array by using a for loop |
|
|
184 | (2) |
|
|
186 | (1) |
|
Sorting an array using the Bubble Sort |
|
|
187 | (7) |
|
Finding the highest and lowest sales values |
|
|
194 | (2) |
|
Working out the total and the average sales |
|
|
196 | (2) |
|
|
198 | (1) |
|
Multiple dimensions in arrays |
|
|
199 | (7) |
|
Using nested for loops to work with two-dimensional arrays |
|
|
201 | (2) |
|
Making test versions of programs |
|
|
203 | (1) |
|
Finding the length of an array dimension |
|
|
204 | (2) |
|
Using arrays as lookup tables |
|
|
206 | (2) |
|
|
208 | (4) |
Part 2: Advanced programming |
|
|
8 Using methods to simplify programs |
|
|
212 | (34) |
|
|
214 | (10) |
|
Adding a method to a class |
|
|
215 | (2) |
|
Feeding information to methods by using parameters |
|
|
217 | (5) |
|
Returning values from method calls |
|
|
222 | (2) |
|
Making a tiny contacts app |
|
|
224 | (17) |
|
Reading in contact details |
|
|
227 | (1) |
|
Storing contact information |
|
|
228 | (1) |
|
Using Windows local storage |
|
|
229 | (2) |
|
Using reference parameters to deliver results from a method call |
|
|
231 | (6) |
|
Displaying the contact details |
|
|
237 | (4) |
|
Adding IntelliSense comments to your methods |
|
|
241 | (2) |
|
|
243 | (3) |
|
9 Creating structured data types |
|
|
246 | (42) |
|
Storing music notes by using a structure |
|
|
248 | (15) |
|
Creating and declaring a structure |
|
|
250 | (2) |
|
Creating arrays of structure values |
|
|
252 | (1) |
|
|
253 | (3) |
|
Constructing structure values |
|
|
256 | (4) |
|
|
260 | (2) |
|
|
262 | (1) |
|
Objects and responsibilities: Making a SongNote play itself |
|
|
263 | (1) |
|
Protecting values held in a structure |
|
|
264 | (3) |
|
Making a drawing program with Snaps |
|
|
267 | (11) |
|
Drawing dots on the screen |
|
|
268 | (1) |
|
Using the DrawDot Snap to draw a dot on the screen |
|
|
269 | (1) |
|
The SnapsCoordinate structure |
|
|
270 | (2) |
|
Using the GetDraggedCoordinate Snap to detect a drawing position |
|
|
272 | (2) |
|
Using the SetDrawingColor Snap to set the drawing color |
|
|
274 | (2) |
|
Using the ClearGraphics Snap to clear the screen |
|
|
276 | (1) |
|
|
277 | (1) |
|
Creating enumerated types |
|
|
278 | (2) |
|
Making decisions with the switch construction |
|
|
280 | (2) |
|
|
282 | (3) |
|
|
282 | (1) |
|
|
283 | (1) |
|
|
284 | (1) |
|
|
285 | (1) |
|
|
285 | (3) |
|
10 Classes and references |
|
|
288 | (48) |
|
|
290 | (16) |
|
Creating a structure to hold contact information |
|
|
290 | (2) |
|
Using the this reference when working with objects |
|
|
292 | (2) |
|
Managing lots of contacts |
|
|
294 | (2) |
|
|
296 | (1) |
|
Designing the Time Tracker user interface |
|
|
297 | (1) |
|
Structuring the Time Tracker program |
|
|
298 | (1) |
|
|
299 | (1) |
|
|
300 | (2) |
|
Adding minutes to a contact |
|
|
302 | (2) |
|
|
304 | (2) |
|
|
306 | (13) |
|
|
306 | (1) |
|
|
307 | (1) |
|
Reference and value types |
|
|
308 | (3) |
|
References and assignments |
|
|
311 | (5) |
|
|
316 | (1) |
|
Arrays of class references |
|
|
317 | (2) |
|
|
319 | (4) |
|
Working through lists of data |
|
|
321 | (1) |
|
Lists and the index value |
|
|
322 | (1) |
|
|
322 | (1) |
|
|
323 | (6) |
|
The Newtonsoft JSON library |
|
|
324 | (2) |
|
Storing and recovering lists |
|
|
326 | (3) |
|
|
329 | (5) |
|
|
334 | (2) |
|
11 Making solutions with objects |
|
|
336 | (38) |
|
Creating objects with integrity |
|
|
338 | (8) |
|
Protecting data held inside an object |
|
|
338 | (3) |
|
Providing Get and Set methods for private data |
|
|
341 | (2) |
|
Providing methods that reflect the use of an object |
|
|
343 | (3) |
|
Using properties to manage access to data |
|
|
346 | (5) |
|
Using properties to enforce business rules |
|
|
349 | (2) |
|
Managing the object construction process |
|
|
351 | (5) |
|
Catching and dealing with exceptions |
|
|
353 | (2) |
|
Creating user-friendly applications |
|
|
355 | (1) |
|
|
356 | (12) |
|
SaveGraphicsImageToFileAsPNG |
|
|
357 | (1) |
|
SaveGraphicsImageToLocalStoreAsPNG |
|
|
358 | (1) |
|
LoadGraphicsPNGImageFromLocal Store |
|
|
358 | (1) |
|
|
359 | (1) |
|
Getting the current date and time |
|
|
360 | (1) |
|
Fading date and time displays |
|
|
360 | (1) |
|
Using the date and time to make a file name |
|
|
361 | (1) |
|
|
362 | (2) |
|
Creating a list of drawings |
|
|
364 | (1) |
|
Making the drawing diary methods |
|
|
365 | (3) |
|
|
368 | (6) |
Part 3: Making games |
|
|
|
374 | (20) |
|
|
376 | (16) |
|
|
376 | (2) |
|
|
378 | (14) |
|
|
392 | (2) |
|
|
394 | (22) |
|
Creating a player-controlled paddle |
|
|
396 | (5) |
|
|
401 | (2) |
|
Displaying text in a game |
|
|
403 | (11) |
|
|
408 | (6) |
|
|
414 | (2) |
|
14 Games and object hierarchies |
|
|
416 | (30) |
|
Games and objects: Space Rockets in Space |
|
|
418 | (22) |
|
Constructing a star sprite that moves |
|
|
419 | (8) |
|
Allowing methods to be overridden |
|
|
427 | (1) |
|
Creating a moving star field |
|
|
428 | (2) |
|
Creating a rocket based on a MovingSprite |
|
|
430 | (2) |
|
|
432 | (8) |
|
Designing a class hierarchy |
|
|
440 | (3) |
|
|
443 | (3) |
|
15 Games and software components |
|
|
446 | (28) |
|
|
448 | (23) |
|
Creating cooperating objects |
|
|
448 | (8) |
|
|
456 | (9) |
|
Interfaces and components |
|
|
465 | (6) |
|
|
471 | (3) |
Index |
|
474 | |