You are on page 1of 18

02 | Core Programming

Gerry OBrien | Technical Content Development Manager


Paul Pardi | Senior Content Publishing Manager
Module Overview

How Computers Store and Manipulate Information


Data Structures
Algorithms
Decision Making
Repetition
Program Errors
Computer Storage and Processing
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, special
Data 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 Even larger signed integer values


9,223,372,036,854,775,807
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


Data Structures

Arrays
Stacks
Queues
Dictionaries
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
Stack

A collection of objects, accessed by pop and push


Queue

A collection of objects, accessed by queuing and dequeuing.


Similar to a line at the motor vehicle license branch

Enqueue Dequeue
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
Demo Data Structures
Algorithms
Start Pancakes
Start Bubble Sort

Add Eggs Get Value One

Get Value Two


Add Flour

No
Is Two Greater
Swap One and Two
Pour in Pan Add Water than One?

Yes

Yes Mix
Serve and Eat
Increment Values End of List?

No
Done Proper List Sorted
Too Thick?
Consistency?
Decision Making

if, if-else, if-else-if


switch or Select Case
Demo Decision Structures
Repetition

for loops
while loops
do-while loops
recursion
Demo Repetition
Program Errors

Syntax errors
Logic errors
Exceptions
Structured Exception Handling
Using the debugger
Demo Errors and Debugging
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.

You might also like