Top Banner
1 of 32 Images from Africa
32

1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

Apr 01, 2015

Download

Documents

Renee Woollard
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

1 of 32

Images from Africa

Page 2: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

2 of 32

My little Haitian friend Antoine (1985)

Page 3: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

3 of 32

Solid Terrain Models

http://www.stm-usa.com/

Page 4: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

4 of 32

3D Touch Table

Page 6: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

6 of 32

Overview

Variables & ExpressionsBasic C# SyntaxCommentsDeclaring & initializing variables

Flow controlBoolean logicBranching & looping

Advanced typesenum, struct, Array

Type conversionsFunctionsVariable scope

Page 7: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

7 of 32

Basic C# Syntax

Page 8: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

8 of 32

Comments

//, ///, /* */

Page 9: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

9 of 32

Declaring & Initializing variables

<type> <name>;<name> = <initial_value>;

OR<type> <name> = <initial_value>;

Page 10: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

10 of 32

Types – esp. Value

Apart from bool, char,& enum, value types havea range of numbers theysupport (p. 37)

Type Range

byte 0 to 255

sbyte -128 to 127

short -32768 to 32767

int -2147483648 to2147483647

Page 11: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

11 of 32

For real numbers …

Page 12: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

12 of 32

Most commonly used types

int

string

double

bool

char

Page 13: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

13 of 32

Variable names & initial values

<type> <name> = <initial_value>;

Variable namesCannot

Be a C# keywordBegin with a number or special char except _ and @Contain chars like -, ‘, etc)

ShouldBe camelCaseDescribe the content

Initial values0 for numbers or what makes sense for appstring.Empty / “” for strings, etc.

Page 14: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

14 of 32

Expressions

<variable> = <operand> <operator> <operand>

// x = x + 1, z = x + 1// x = x + 1, z = x// x = x - 1, z = x – 1// x = x - 1, z = x

p. 46, 47 in Watson et al.++x add before expression evaluatedx++ add after expression evaluated

Page 15: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

15 of 32

Overview

Variables & ExpressionsBasic C# SyntaxCommentsDeclaring & initializing variables

Flow controlBoolean logicBranching & looping

Advanced typesenum, struct, Array

Type conversionsFunctionsVariable scope

Page 16: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

16 of 32

Boolean Logic

Page 17: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

17 of 32

Branching with if

Page 18: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

18 of 32

Branching with switch

Page 19: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

19 of 32

Looping with for

Page 20: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

20 of 32

Looping with while

Page 21: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

21 of 32

Looping with do

Page 22: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

22 of 32

Interrupting loops

breakExit from loop

continueReturn to top of loop

returnExit from loop & containing function

Page 23: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

23 of 32

Overview

Variables & ExpressionsBasic C# SyntaxCommentsDeclaring & initializing variables

Flow controlBoolean logicBranching & looping

Advanced typesenum, struct, Array

Type conversionsFunctionsVariable scope

Page 24: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

24 of 32

Advanced types – enum

To constrain the possible values for a variableDeclared at same level as classPlain text names associated with number

Page 25: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

25 of 32

Advanced types – struct

A custom, multi-valued, type that can have functions

Declared at same level as classCan contain value types (int, long, double, etc) and strings

Page 26: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

26 of 32

Advanced types – Array

Making it easier to create/access groups of values of the same type

Page 27: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

27 of 32

Overview

Variables & ExpressionsBasic C# SyntaxCommentsDeclaring & initializing variables

Flow controlBoolean logicBranching & looping

Advanced typesenum, struct, Array

Type conversionsFunctionsVariable scope

Page 28: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

28 of 32

Type conversions

Types with smaller range can be implicitly converted to types with larger rangeOther types MAY be explicitly converted target_type outvar = (target_type) variableName

Page 29: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

29 of 32

Functions: Defining and calling

Syntax for defining functions: [scope] [static] return_type name ([params]){ // C# statements [return [return_value]];}

0 or more params are declared like variables and comma separated.

Page 30: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

30 of 32

Params by ref and by value

Page 31: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

31 of 32

Variable Scope

Page 32: 1 of 32 Images from Africa. 2 of 32 My little Haitian friend Antoine (1985)

32 of 32

Funny if it wasn’t true

Air Transat ad

My version