02 | core programming gerry o’brien | technical content development manager paul pardi | senior...

18
Click to edit Master subtitle style 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Upload: irma-ellis

Post on 14-Dec-2015

214 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Click to edit Master subtitle style

02 | Core Programming

Gerry O’Brien | Technical Content Development ManagerPaul Pardi | Senior Content Publishing Manager

Page 2: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

• How Computers Store and Manipulate Information

• Data Structures

• Algorithms

• Decision Making

• Repetition

• Program Errors

Module Overview

Page 3: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Computer Storage and Processing

Page 4: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Variables, Constants, and Data Types• Variable – provides a temporary, named storage location in computer

memory

• Constant – either a named storage location or literal value. Cannot be changed during program execution

• Data Types – numeric, character, specialData Type Range Description

byte 0 to 255 A single byte (8 bits)

char Any Unicode character Characters used in most languages in the world

short -32,768 to 32,767 Signed integer values

int -2,147,483,648 to 2,147,483,647 Larger signed integer values

long 9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

Even larger signed integer values

float +/- 1.5 x 10-45 to +/- 3.4 x1038 Floating point signed values

Double +/- 5.0e -324 to +/- 1.7e308 Large floating point signed values

String String of characters Words, sentences, phrases, etc.

Boolean True or False Used to represent true or false, 1 or 0

Page 5: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Data Structures

• Arrays

• Stacks

• Queues

• Dictionaries

Page 6: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Arrays

• A collection of similar data types accessed by index

Index Value

0 Item1

1 Item2

2 Item3

3 Item4

4 Item5

5 Item6

6 Item7

7 Item8

8 Item9

9 Item10

Page 7: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Stack

• A collection of objects, accessed by pop and push

Page 8: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Queue

• A collection of objects, accessed by queuing and dequeuing. Similar to a line at the motor vehicle license branch

Enqueue Dequeue

Page 9: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Dictionary

• A collection of objects that are accessed by using a key

Key Value

Key1 First Item

Key2 Second Item

Key3 Third Item

Key4 Fourth Item

Key5 Fifth Item

Page 10: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Demo Data Structures

Page 11: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

AlgorithmsStart Pancakes

Add Eggs

Add Flour

Add Water

Mix

Proper Consistency?

Pour in Pan

Serve and Eat

DoneToo Thick?

No

No

Yes

Yes

Start Bubble Sort

Get Value One

Get Value Two

Is Two Greater than One?

End of List?

List Sorted

Swap One and Two

Increment Values

Paul Pardi
Do you need your yes/no on the arrows for the bubble sort?
Page 12: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Decision Making

• if, if-else, if-else-if

• switch or Select Case

Page 13: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Demo Decision Structures

Page 14: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Repetition

• for loops

• while loops

• do-while loops

• recursion

Page 15: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Demo Repetition

Page 16: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Program Errors

• Syntax errors

• Logic errors

• Exceptions

• Structured Exception Handling

• Using the debugger

Page 17: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

Demo Errors and Debugging

Page 18: 02 | Core Programming Gerry O’Brien | Technical Content Development Manager Paul Pardi | Senior Content Publishing Manager

©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.