intel ultimate engineering experience. introductions

29
INTEL ULTIMATE ENG INEE RING EXP ERIE N CE

Upload: jasmin-todd

Post on 21-Jan-2016

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

INTE

L ULT

IMAT

E

EN

GI N

EE

RI N

G E

XP

ER

I EN

CE

Page 2: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

INTR

ODUCTIONS

Page 3: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

INSTRUCTORS

B R A D N I C H O L S

[email protected]

M I C H A E L K A T I C

[email protected]

R Y A N S C O T T

[email protected]

Feel free to contact any of us for whatever reason If you cant figure out an error or are stuck on a design issue just shoot an email to one of our email and we’ll help out the best we can!

I sure do love

making mobile apps!

Come on in, the code is GREAT!

Come try on your

computer science hats!

Page 4: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

WHO SPEAKS COMPUTER?

Page 5: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

Join us on Facebook

And Wikispaces!

FACEBOOK

Page 6: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

Computer Programming is the:• Designing• Writing• Testing• Debugging• and Maintaining

of source code of computer programs.

WHAT IS PROGRAMMING?

Page 7: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

PayStarting Salaries in computer programming range from $59,000 to $112,000 per yearContract jobs run as high as $100 to $400 per hour

Flexibility & IndependenceWork from home as freelance contractorNearly always able to work from homeBring your work anywhereThe “Do good work and we wont ask questions” policy

Demand & Job SecurityAs long as society relies on computing technology, there will be a demand for computer programmers.

WHY DO I WANT TO BE A COMPUTER PROGRAMMER?

Notes from: http://www.indeed.com/

http://www.askitcareercoach.com/ http://smallbusiness.chron.com/advantages-being-computer-programmer-38637.html

Page 8: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

• While (Students.Understand() == false)Students.teachProgramming();

• Hello, World!• Variables, Variable Types

Monday

• Roll Playing Game• Loops, Conditionals, and Functions• Classes and Objects• Random class

Tuesday

• Creating a Tip Calculator• String Manipulation• Graphics• Drawing to a Window

Wednesday

• Build your own application or gameThursday• Build your own application or gameFriday

COURSE SCHEDULE

Page 9: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

HELLO W

ORLD

TI M

E T

O G

ET

ST A

RT

ED

Page 10: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

HELLO, WORLD!

class Program { static void Main(string[] args) { Console.WriteLine("Hello, World!"); } }

TIP:Don’t forget to add

Console.ReadKey(true);to stop the console window from closing.

Hello World TutorialGeneral Structure of a C# Program

Main() and Command-Line Arguments

Page 11: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

PROGRAMMIN

G BASIC

S

Page 12: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

//COMMENTING YOUR CODE

When your programming you may want to leave behind notes.

To do this we use double backslashes at the beginning of the line we wish to put notes on.

For example:

//Print out text to the screen.

Console.WriteLine("Hello, World!");

The line above in green will be ignored and acts at a note to whomever reads the code.

Page 13: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

TYPES AND VARIABLES

int

1

-5

double

.999

15.1

String

“Hello”

“ “

bool

true

false

Declaration of a Variableint x;The line above creates a new variable named “x” of type int

Initialization of a Variablex = 5;This line set our variable “x” to the value 5

Accessing a Variableint z = x;This accesses the value assigned to variable “x” and assigns it to the value of the variable “z”

More on Types

Page 14: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

OPERATORS

We can use symbols in c# like “+, -, *, /” to perform operations.

int x = 5 + 1; //This sets x to 6

int y = x + 1; //Sets y to 7

Knowing the type of the variable allows our operations to behave differently based on the type. For example observe the two different outputs below.

More on Operators

int x = 5;int y = 6;Console.WriteLine(x + y);

String x = 5;String y = 6;Console.WriteLine(x + y);

11 56

Page 15: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

CONDITIONALS

< less than > greater than <= less than or equal to >= greater than or equal to == equal to != not equal to && logical “and” (True only if both sides are true. False otherwise.) || logical “or” (False only if both sides are false. True otherwise.)

Example:if( X > 3 && X < 6 )if( hitPoints == fullHitPoints )

Page 16: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

LEARNING CONDITIONALS

The "if" Statement 

 static void Main(String[] args)

        {

            int x;

            x=20;

            if (x > 0)

            {

                x -= 1;

                Console.WriteLine(x);

            }

        }

Page 17: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

IF ELSE VS. SWITCH STATEMENTS

I F E L S E S T A T E M E N T

if(number ==1){

// Print 1}else if( number ==2){

// Print 2}else{

// Print number}

S W I T C H S T A T E M E N T

switch(number){

case 1:{ // Print 1}break;

case 2:{ // Print 2}break;

default:{ // Print

number}break;

}

Page 18: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

LEARNING LOOPS

The 'While' Loop

while (count < maxCount)

{

Console.WriteLine(count);

count++;

}

Console.ReadLine();

Page 19: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

METHODS/F

UNCTIONS

Page 20: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

DECLARING A METHOD

Just like we have functions in math we have methods in C#. And just like in math our functions have some input and some output. (see example below of how to create a method)

Declaration of a Method

bool f(int x)

{

//Do some stuff in here. Don’t forget to return a bool.

}

The lines above create a new function named “f” that takes an input “x” of type int and returns a bool value.

More on Methods

Page 21: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

METHOD EXAMPLE

The method below returns true when it is given an input of “0” otherwise it returns false.

bool isZero(int val)

{

if (val == 0)

{

return true;

}

else

{

return false;}

}

Page 22: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

CALLING A METHOD

Now if I want to use my new method to check if a value is zero I can do that like this:

int x = 0;

int y = 5;

bool xCheck;

bool yCheck;

xCheck = isZero(x); //xCheck is now set to true

yCheck = isZero(y); //yCheck is now set to false

Page 23: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

CLASSES/O

BJECTS

Page 24: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

CLASSES

A N I M A L . C S

Animal

name

age

weight

M A I N ( )

Animal myAnimal = new Animal();

Console.WriteLine(myAnimal.name);

Console.WriteLine(myAnimal.weight + “ Pounds”);

myAnimal.Eat();

Console.WriteLine(myAnimal.weight + “ Pounds”);

Ryan

10

125

CONSOLE WINDOWRyan125 Pounds126 Pounds

weight++; Eat()

Note: “weight++” is equivalent to “weight = weight + 1”

Page 25: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

Dog breed

Animal

name

age

weight

INHERITANCED O G . C S

M A I N ( )

Dog myDog = new Dog();

Console.WriteLine(myDog.breed);

myDog.breed = “Dalmation”

Console.WriteLine(myDog.breed);

Console.WriteLine(myDog.age);

CONSOLE WINDOWPugDalmation10

Pug

Ryan

10

125

weight++; Eat()

Page 26: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

RANDOM NUMBER GENERATOR CLASS

- Based off of “seeds”- Only 1 needed per Program- Used to create sudo-random content

- Random rand = new Random();

- Int number =rand.Next(min,max);

Page 27: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

RESEARCHING YOUR ISSUES

Google is your friend!

Here are some other friends you might want to become familiar with:

• MSDN Learning Recources

• Top C# Questions on Stack Overflow

• Get More Out of Google

Page 28: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

GETTING A JUMP START ON TOMORROW

Tomorrow we will be learning more about the following:

• Conditionals, Loops, and Methods• Classes• Random class

To get a head start you can visit the links above and play around with some of the code provided.HAPPY CODING

Page 29: INTEL ULTIMATE ENGINEERING EXPERIENCE. INTRODUCTIONS

INTE

L ULT

IMAT

E

EN

GI N

EE

RI N

G E

XP

ER

I EN

CE