-
Notifications
You must be signed in to change notification settings - Fork 0
/
cs101_chapter1.html
577 lines (484 loc) · 29.2 KB
/
cs101_chapter1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-7">
<title>Computer Science 101: Data Abstraction</title>
<meta name="description" content="Teaching Slides for Computer Science 101">
<meta name="author" content="Gregory M. Kapfhammer">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/theme/night-gkapfham.css" id="theme">
<!-- For syntax highlighting -->
<link rel="stylesheet" href="lib/css/zenburn.css">
<!-- Install Font Awesome and the Google Web fonts -->
<link href="https://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Montserrat|Roboto+Slab" rel="stylesheet" type="text/css">
<!-- If the query includes 'print-pdf', include the PDF print sheet -->
<script>
if( window.location.search.match( /print-pdf/gi ) ) {
var link = document.createElement( 'link' );
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = 'css/print/pdf.css';
document.getElementsByTagName( 'head' )[0].appendChild( link );
}
</script>
</head>
<body>
<div class="reveal">
<div class="slides">
<section data-background-transition="none" data-background="https://images.unsplash.com/photo-1452860606245-08befc0ff44b" style="background: rgba(29,31,33,0.9)">
<h1>Computer Science 101</h1>
<h2>Data Abstraction</h2>
<p>Gregory M. Kapfhammer</p>
</section>
<section>
<h1>Color Scheme</h1>
<p class="fragment"><b class="orange">Key Concept</b></p>
<p class="fragment"><b class="purple">Corresponding Diagram</b></p>
<p class="fragment"><b class="green">In-Class Discussion</b></p>
<p class="fragment"><b class="red">In-Class Activity</b></p>
<p class="fragment"><b class="blue">Details in the Textbook</b></p>
</section>
<section>
<h1><b class="red">Sit together in groups of three</b></h1>
</section>
<section>
<h1>Important Software</h1>
<p class="fragment">Compiler</p>
<p class="fragment">Java virtual machine</p>
<p class="fragment"><b class="green">What are the inputs and outputs of these programs?</b></p>
<p class="fragment"><b class="red">Draw a picture showing how these are related!</b></p>
</section>
<section>
<h1 id="variables">Variables</h1>
<p class="fragment">Types</p>
<p class="fragment">Declaration</p>
<p class="fragment">Assignment</p>
<p class="fragment">Constants</p>
<p class="fragment"><b class="green">How should we organize the declarations in our programs?</b></p>
</section>
<section data-background-transition="none" data-background="https://farm5.static.flickr.com/4124/5068845349_4bb9f8fec9.jpg" style="">
</section>
<section data-background-transition="none" data-background="https://farm5.static.flickr.com/4124/5068845349_4bb9f8fec9.jpg" style="background: rgba(29,31,33,0.9)">
<h1 id="primitive_data_types">Primitive Types</h1>
<p class="fragment">Integers and floating point values</p>
<p class="fragment">Bit-depth trade-offs</p>
<p class="fragment">Resource-constrained devices</p>
<p class="fragment">Character strings and booleans</p>
<p class="fragment"><b class="green">What does this look like in memory?</b></p>
<br /><small><a href="https://creativecommons.org/licenses/by-sa/2.0/">creative commons licensed ( BY-SA )</a> <a title="binary bridge" href="https://flickr.com/photos/mcclanahoochie/5068845349">flickr photo</a> shared by <a href="https://flickr.com/people/mcclanahoochie">mcclanahoochie</a></small>
</section>
<section>
<h1 id="variables">Use typed variables to compute values!</h1>
</section>
<section data-background-transition="none" data-background="https://farm2.static.flickr.com/1228/1023015396_9cfff2939d.jpg" style="">
</section>
<section data-background-transition="none" data-background="https://farm2.static.flickr.com/1228/1023015396_9cfff2939d.jpg" style="background: rgba(29,31,33,0.9)">
<h1 id="primitive_data_types">Expressions</h1>
<p class="fragment">Arithmetic operators: <code>+, -, *, /, %</code></p>
<p class="fragment"><b class="green">Wait, what does <code>%</code> mean?</b></p>
<p class="fragment">Operator <b class="orange">precedence</b></p>
<p class="fragment">What about <b class="orange">parentheses</b>?</p>
<p class="fragment"><b class="blue">Review Sections 1.4.1 and 1.4.2 for more details</b></p>
<br /><small><a href="https://creativecommons.org/licenses/by-nc-sa/2.0/">creative commons licensed ( BY-NC-SA )</a> <a title="Shock" href="https://flickr.com/photos/jannemei/1023015396">flickr photo</a> shared by <a href="https://flickr.com/people/jannemei">jannemei</a></small>
</section>
<section>
<h1 id="data_conversion">Type Conversion</h1>
<p class="fragment"><b class="green">Can we ever transform one data type into another?</b></p>
<p class="fragment">We can use <b class="orange">widening</b> and <b class="orange">shortening</b> conversions</p>
<p class="fragment">Converting from a <code>byte</code> to a <code>short</code> is safe! <b class="green">Why</b>?</p>
<p class="fragment">Narrowing conversions can lead to information loss. <b class="green">Why</b>?</p>
<p class="fragment"><b class="blue">Refer to Section 1.4.3 for details about casting</b></p>
</section>
<section>
<h1 id="conversion_techniques">Conversion Techniques</h1>
<p class="fragment"><u>Assignment</u> conversion: <b class="orange"><code>money = dollars</code></b> ... </p>
<p class="fragment">... when dollars is an <code>int</code> and money is a <code>float</code></p>
<p class="fragment"><u>Promotion</u> conversion: <b class="orange"><code>result = sum / count</code></b> ... </p>
<p class="fragment">... when sum is a <code>float</code> and count is an <code>int</code></p>
<p class="fragment"><u>Casting</u> conversion: <b class="orange"><code>dollars = (int) money</code></b> ... </p>
<p class="fragment">... when dollars is an <code>int</code> and money is a <code>float</code></p>
</section>
<section>
<h1 id="variables">What does this look like in a program?</h1>
</section>
<section>
<h1 id="java_programs">Java Programs</h1>
<pre><code data-trim>
public class Lincoln
{
// prints a presidential quotation
public static void main (String[] args)
{
System.out.println ("A quote by Abraham Lincoln:");
System.out.println ("Whatever you are, be a good one.");
}
}
</code>
</pre>
<p class="fragment">Can you find? ... <b class="orange">The definition of a class</b></p>
</section>
<section>
<h1 id="java_programs">Java Programs</h1>
<pre><code data-trim>
public class Lincoln
{
// prints a presidential quotation
public static void main (String[] args)
{
System.out.println ("A quote by Abraham Lincoln:");
System.out.println ("Whatever you are, be a good one.");
}
}
</code>
</pre>
<p class="fragment">Can you find? ... <b class="orange">The main method</b></p>
</section>
<section>
<h1 id="java_programs">Java Programs</h1>
<pre><code data-trim>
public class Lincoln
{
// prints a presidential quotation
public static void main (String[] args)
{
System.out.println ("A quote by Abraham Lincoln:");
System.out.println ("Whatever you are, be a good one.");
}
}
</code>
</pre>
<p class="fragment">Can you find? ... <b class="orange">Java keywords</b></p>
</section>
<section>
<h1 id="java_programs">Java Programs</h1>
<pre><code data-trim>
public class Lincoln
{
// prints a presidential quotation
public static void main (String[] args)
{
System.out.println ("A quote by Abraham Lincoln:");
System.out.println ("Whatever you are, be a good one.");
}
}
</code>
</pre>
<p class="fragment">Can you find? ... <b class="orange">A method invocation</b></p>
</section>
<section>
<h1 id="java_programs">Java Programs</h1>
<pre><code data-trim>
public class Lincoln
{
// prints a presidential quotation
public static void main (String[] args)
{
System.out.println ("A quote by Abraham Lincoln:");
System.out.println ("Whatever you are, be a good one.");
}
}
</code>
</pre>
<p class="fragment">Can you find? ... <b class="orange">A character string</b></p>
</section>
<section>
<h1 id="java_programs">Java Programs</h1>
<pre><code data-trim>
public class Lincoln
{
// prints a presidential quotation
public static void main (String[] args)
{
System.out.println ("A quote by Abraham Lincoln:");
System.out.println ("Whatever you are, be a good one.");
}
}
</code>
</pre>
<p class="fragment">Can you find? ... <b class="orange">A single line comment</b></p>
</section>
<section>
<h1 id="java_programs">Java Programs</h1>
<pre><code data-trim>
public class Lincoln
{
// prints a presidential quotation
public static void main (String[] args)
{
System.out.println ("A quote by Abraham Lincoln:");
System.out.println ("Whatever you are, be a good one.");
}
}
</code>
</pre>
<p class="fragment">Can you find? ... <b class="orange">A static variable</b></p>
</section>
<section>
<h1 id="if_statements">If Statements</h1>
<p class="fragment"><b class="orange">Allows us to implement conditional logic</b></p>
<p class="fragment">Consider <code>if(hours>STANDARD)</code></p>
<p class="fragment">Consider <code>if(myCoin.isHeads())</code></p>
<p class="fragment"><b class="orange">Wait! We can also have an else component!</b></p>
<p class="fragment"><b class="green">Any questions about the use of this construct?</b></p>
<p class="fragment"><b class="blue">Review Section 1.5 for additional details</b></p>
</section>
<section>
<h1 id="comparing_data">Comparing Data</h1>
<p class="fragment">Floats, characters, and objects</p>
<p class="fragment">Different methods for different data</p>
<p class="fragment"><b class="orange">Boolean and int are easy!</b></p>
<p class="fragment"><b class="blue">Remember, characters are just numbers!</b></p>
<p class="fragment"><b class="orange">Comparing a floating point is hard! Why?</b></p>
<p class="fragment"><b class="orange">For objects, we look at the address in memory</b></p>
</section>
<section>
<h1>Iteration Constructs</h1>
<p class="fragment"><b class="orange">Perform some action repeatedly</b></p>
<p class="fragment">Looping constructs: <code>for</code>, <code>while</code>, <code>do-while</code></p>
<p class="fragment"><b class="green">What are the similarities and differences?</b></p>
<p class="fragment"><b class="green">When would you decide to use a certain construct?</b></p>
<p class="fragment">Loops can tax the limited resources of a computer</p>
</section>
<section>
<h1><b class="orange">Iteration and recursion are often viable alternatives</b></h1>
</section>
<section>
<h1><b class="green">What is an intuitive definition of recursion?</b></h1>
</section>
<!-- <section> -->
<!-- <h1>Let's Try It!</h1> -->
<!-- <p class="fragment">Go to the <code>#class</code> channel in our Slack team</p> -->
<!-- <p class="fragment"><b class="red">Save, compile, and run the <code>WhileLoopExample</code> program</b></p> -->
<!-- <p class="fragment">This file is also available in our "share" repository</p> -->
<!-- <p class="fragment"><b class="green">What is the output of this program?</b></p> -->
<!-- <p class="fragment"><b class="green">Does this program have a defect in it?</b></p> -->
<!-- <p class="fragment"><b class="green">If it does, can you fix the program?</b></p> -->
<!-- </section> -->
<!-- <section> -->
<!-- <h1>More Iteration!</h1> -->
<!-- <p class="fragment">Go to the <code>#class</code> channel in our Slack team</p> -->
<!-- <p class="fragment"><b class="red">Save, compile, and run the <code>LogisticMap</code> program</b></p> -->
<!-- <p class="fragment">This file is also available in our "share" repository</p> -->
<!-- <p class="fragment">Be careful! Run it with: <code>java LogisticMap 0</code></p> -->
<!-- <p class="fragment">Try it again! Run it with: <code>java LogisticMap 0.825250</code></p> -->
<!-- <p class="fragment"><b class="green">What is the output of this program?</b></p> -->
<!-- <p class="fragment"><b class="green">How does this program create graphical output?</b></p> -->
<!-- </section> -->
<!-- <section> -->
<!-- <h1>Iteration Investigation</h1> -->
<!-- <p class="fragment">Try many different inputs: <code>java LogisticMap 0.825250</code></p> -->
<!-- <p class="fragment"><b class="green">Where are the split points in this graph?</b></p> -->
<!-- <p class="fragment"><b class="green">Where does the function depart into chaos?</b></p> -->
<!-- <p class="fragment"><b class="green">How does this program use iteration constructs?</b></p> -->
<!-- <p class="fragment"><b class="orange">This program combines conditional logic and iteration</b></p> -->
<!-- <p class="fragment"><b class="blue">Review Section 1.5.2 for more details!</b></p> -->
<!-- </section> -->
<!-- <section> -->
<!-- <h1><b class="red">Review basic concepts while exploring new frontiers</b></h1> -->
<!-- </section> -->
<!-- <section data-background-transition="none" data-background="https://farm6.static.flickr.com/5599/15701974516_e44a8e1182_b.jpg" style=""> -->
<!-- </section> -->
<!-- <section data-background-transition="none" data-background="https://farm6.static.flickr.com/5599/15701974516_e44a8e1182_b.jpg" style="background: rgba(29,31,33,0.9)"> -->
<!-- <h1>Greatest Common Divisor</h1> -->
<!-- <p class="fragment"><b class="red">Develop an example of this with your partner</b></p> -->
<!-- <p class="fragment">How can you compute the GCD of two numbers?</p> -->
<!-- <p class="fragment">What is the most efficient way to compute GCD?</p> -->
<!-- <br /><small><a title="RAF Reservist on Uniform to Work Day" href="https://flickr.com/photos/defenceimages/15701974516">flickr photo</a> shared by <a href="https://flickr.com/people/defenceimages">Defence Images</a> under a <a href="https://creativecommons.org/licenses/by-nc-nd/2.0/">Creative Commons ( BY-NC-ND ) license</a> </small> -->
<!-- </section> -->
<!-- <section data-background-transition="none" data-background="https://farm6.static.flickr.com/5599/15701974516_e44a8e1182_b.jpg" style="background: rgba(29,31,33,0.9)"> -->
<!-- <h1>Iterative GCD</h1> -->
<!-- <p class="fragment"><b class="red">Download this example from the "share" repository</b></p> -->
<!-- <p class="fragment"><b class="red">Run this program many times and study the output</b></p> -->
<!-- <p class="fragment"><b class="green">How does this program work?</b></p> -->
<!-- <p class="fragment"><b class="red">Comment out the debugging statements</b></p> -->
<!-- <p class="fragment"><b class="red">Perform a timing experiment to evaluate performance</b></p> -->
<!-- <p class="fragment"><b class="orange"><code>/usr/bin/time java IterativeGCD 10 2</b></code></p> -->
<!-- <br /><small><a title="RAF Reservist on Uniform to Work Day" href="https://flickr.com/photos/defenceimages/15701974516">flickr photo</a> shared by <a href="https://flickr.com/people/defenceimages">Defence Images</a> under a <a href="https://creativecommons.org/licenses/by-nc-nd/2.0/">Creative Commons ( BY-NC-ND ) license</a> </small> -->
<!-- </section> -->
<!-- <section data-background-transition="none" data-background="https://farm6.static.flickr.com/5599/15701974516_e44a8e1182_b.jpg" style="background: rgba(29,31,33,0.9)"> -->
<!-- <h1>Recursive GCD</h1> -->
<!-- <p class="fragment"><b class="red">Add some debugging statements</b></p> -->
<!-- <p class="fragment"><b class="red">Run this program many times and study the output</b></p> -->
<!-- <p class="fragment"><b class="green">How does this program work?</b></p> -->
<!-- <p class="fragment"><b class="red">Comment out the debugging statements</b></p> -->
<!-- <p class="fragment"><b class="red">Perform a timing experiment to evaluate performance</b></p> -->
<!-- <p class="fragment"><b class="orange"><code>/usr/bin/time java RecursiveGCD 10 2</b></code></p> -->
<!-- <br /><small><a title="RAF Reservist on Uniform to Work Day" href="https://flickr.com/photos/defenceimages/15701974516">flickr photo</a> shared by <a href="https://flickr.com/people/defenceimages">Defence Images</a> under a <a href="https://creativecommons.org/licenses/by-nc-nd/2.0/">Creative Commons ( BY-NC-ND ) license</a> </small> -->
<!-- </section> -->
<!-- <section> -->
<!-- <h1><b class="green">Which of these programs is faster? Why?</b></h1> -->
<!-- </section> -->
<!-- <section> -->
<!-- <h1><b class="orange">Calculation of elapsed time for a method</b></h1> -->
<!-- </section> -->
<!-- <section data-background-transition="none" data-background="https://farm8.static.flickr.com/7375/9955308916_9ff1f61130_b.jpg" style=""> -->
<!-- </section> -->
<!-- <section data-background-transition="none" data-background="https://farm8.static.flickr.com/7375/9955308916_9ff1f61130_b.jpg" style="background: rgba(29,31,33,0.9)"> -->
<!-- <h1>Factorial</h1> -->
<!-- <p class="fragment"><b class="red">Develop an example of this with your partner</b></p> -->
<!-- <p class="fragment">How can you compute the factorial of a number?</p> -->
<!-- <p class="fragment">What is the most efficient way to compute factorial?</p> -->
<!-- <br /><small><a title="Examining Specimen" href="https://flickr.com/photos/nationaleyeinstitute/9955308916">flickr photo</a> shared by <a href="https://flickr.com/people/nationaleyeinstitute">National Eye Institute</a> under a <a href="https://creativecommons.org/licenses/by/2.0/">Creative Commons ( BY ) license</a> </small> -->
<!-- </section> -->
<!-- <section data-background-transition="none" data-background="https://farm8.static.flickr.com/7375/9955308916_9ff1f61130_b.jpg" style="background: rgba(29,31,33,0.9)"> -->
<!-- <h1>Iterative Factorial</h1> -->
<!-- <p class="fragment"><b class="red">Run this program several times and study the output</b></p> -->
<!-- <p class="fragment"><b class="green">How does this program work?</b></p> -->
<!-- <p class="fragment"><b class="green">What is the maximum value that can be computed?</b></p> -->
<!-- <p class="fragment"><b class="red">Perform a timing experiment to evaluate performance</b></p> -->
<!-- <p class="fragment"><b class="orange"><code>/usr/bin/time java IterativeFactorial 10</b></code></p> -->
<!-- <br /><small><a title="Examining Specimen" href="https://flickr.com/photos/nationaleyeinstitute/9955308916">flickr photo</a> shared by <a href="https://flickr.com/people/nationaleyeinstitute">National Eye Institute</a> under a <a href="https://creativecommons.org/licenses/by/2.0/">Creative Commons ( BY ) license</a> </small> -->
<!-- </section> -->
<!-- <section data-background-transition="none" data-background="https://farm8.static.flickr.com/7375/9955308916_9ff1f61130_b.jpg" style="background: rgba(29,31,33,0.9)"> -->
<!-- <h1>Recursive Factorial</h1> -->
<!-- <p class="fragment"><b class="red">Add some debugging statements</b></p> -->
<!-- <p class="fragment"><b class="red">Run this program several times and study the output</b></p> -->
<!-- <p class="fragment"><b class="green">How does this program work?</b></p> -->
<!-- <p class="fragment"><b class="red">Perform a timing experiment to evaluate performance</b></p> -->
<!-- <p class="fragment"><b class="orange"><code>/usr/bin/time java RecursiveFactorial 10</b></code></p> -->
<!-- <br /><small><a title="Examining Specimen" href="https://flickr.com/photos/nationaleyeinstitute/9955308916">flickr photo</a> shared by <a href="https://flickr.com/people/nationaleyeinstitute">National Eye Institute</a> under a <a href="https://creativecommons.org/licenses/by/2.0/">Creative Commons ( BY ) license</a> </small> -->
<!-- </section> -->
<!-- <section> -->
<!-- <h1><b class="green">Which of these programs is faster? Why?</b></h1> -->
<!-- </section> -->
<!-- <section> -->
<!-- <h1><b class="red">Compare and contrast results from experiments</b></h1> -->
<!-- </section> -->
<!-- <section> -->
<!-- <h1><b class="green">Why are these results evident?</b></h1> -->
<!-- </section> -->
<!-- <section> -->
<!-- <h1><b class="green">Will the results ever be different?</b></h1> -->
<!-- </section> -->
<section>
<h1>Object-Oriented Programming</h1>
<p class="fragment">A class defines behavior and data</p>
<p class="fragment">An object is an instance of a class</p>
<p class="fragment">Methods define behavior and variables store the data</p>
</section>
<section>
<h1>Object-Oriented Programming</h1>
<p class="fragment">Visibility modifiers control access</p>
<p class="fragment">Variables/methods can either be instance or static</p>
<p class="fragment">Inheritance supports code reuse</p>
</section>
<section>
<h1>Methods</h1>
<p class="fragment">Methods have a "signature"</p>
<p class="fragment">Returns values and parameters</p>
<p class="fragment">Parameter passing in the Java language</p>
<p class="fragment"><b class="green">Any questions about using methods in Java?</b></p>
</section>
<section>
<h1><b class="red">Parameter passing in Java?</b></h1>
<p class="fragment">Describe a Java program that includes a method that can swap two values.</p>
</section>
<section>
<h1><b class="green">Challenges associated with creating this program?</b></h1>
</section>
<section>
<h1><b class="orange">Solution One: Using int variables does not work!</b></h1>
</section>
<section>
<h1><b class="orange">Solution Two: Using Integer variables does not work!</b></h1>
</section>
<section>
<h1><b class="green">Can you develop a new data type that will work?</b></h1>
</section>
<section>
<h1><b class="red">Try to create a solution for next class!</b></h1>
</section>
<section>
<h1><b class="red">Be prepared to explain your solution!</b></h1>
</section>
<section data-background-transition="none" data-background="https://farm1.static.flickr.com/71/219071714_dc5b98c22d_o.jpg" style="">
</section>
<section data-background-transition="none" data-background="https://farm1.static.flickr.com/71/219071714_dc5b98c22d_o.jpg" style="background: rgba(29,31,33,0.9)">
<h1 id="string_manipulation">String Manipulation</h1>
<p class="fragment"><b class="green">Real world examples of string processing?</b></p>
<p class="fragment"><b class="orange">Purpose of and ways to index a string?</b></p>
<p class="fragment"><b class="blue">See Section 1.3 for more details about Strings</b></p>
<br /><small><a title="Finger dance" href="https://flickr.com/photos/jamesjordan/219071714">flickr photo</a> shared by <a href="https://flickr.com/people/jamesjordan">James Jordan</a> under a <a href="https://creativecommons.org/licenses/by-nc-nd/2.0/">Creative Commons ( BY-NC-ND ) license</a> </small>
</section>
<section>
<h1>Arrays</h1>
<p class="fragment">Arrays allow you to store a fixed number of variables</p>
<p class="fragment">All values in the array are of the same type</p>
<p class="fragment">Indexing an array can lead to out of bounds exceptions</p>
<p class="fragment"><b class="red">Compare and contrast arrays and ArrayLists</b></p>
<p class="fragment"><b class="green">Any questions about using arrays in Java?</b></p>
</section>
<section>
<h1>Packages and Imports</h1>
<p class="fragment">Let's keep our source code organized!</p>
<p class="fragment">Place related Java classes into a package</p>
<p class="fragment">Make sure that your directories are correctly organized</p>
<p class="fragment"><b class="red">Create an example of a package and a directory structure</b></p>
<p class="fragment"><b class="green">Any questions about using packages in Java?</b></p>
</section>
<section>
<h1><b class="blue">Review the details of the CreditCard class</b></h1>
</section>
<section>
<h1>CreditCard</h1>
<p class="fragment">Instance variables</p>
<p class="fragment">Constructors</p>
<p class="fragment">Accessor methods</p>
<p class="fragment">Utility method</p>
<p class="fragment">Main method</p>
<p class="fragment"><b class="green">How would you test this Java class?</b></p>
</section>
<section>
<h1><b class="green">Any questions about the CreditCard example?</b></h1>
</section>
<section>
<h1><b class="blue">Simple input and output</b></h1>
</section>
<section>
<h1><b class="red">Programming Challenge</b></h1>
<p class="fragment">Write a Java program called <code>SimpleInput.java</code> that reads an integer value from
the user with <code>java.util.Scanner</code>, generates a random integer value with
<code>java.util.Random</code>, sums these two integers, and then outputs the result of the addition.</p>
</section>
<section>
<h1><b class="green">Any questions about the programming challenge?</b></h1>
</section>
<section>
<h1><b class="blue">See Section 1.6 for more details</b></h1>
</section>
<section>
<h1><b class="orange">Now, let's highlight software development tasks</b></h1>
</section>
</div>
</div>
<script src="lib/js/head.min.js"></script>
<script src="js/reveal.min.js"></script>
<script>
// Full list of configuration options available here:
// https://github.com/hakimel/reveal.js#configuration
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme, // available themes are in /css/theme
transition: Reveal.getQueryHash().transition || 'none', // default/cube/page/concave/zoom/linear/fade/none
// Parallax scrolling
// parallaxBackgroundImage: 'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg',
// parallaxBackgroundSize: '2100px 900px',
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } }
]
});
</script>
</body>
</html>