1 / 29

Intel Ultimate

Intel Ultimate. Engineering Experience. Introductions. Come on in, the code is GREAT!. Instructors. I sure do love making mobile apps!. Brad Nichols. Michael Katic. michaelkatic@gmail.com. bnichols@spsu.edu. Ryan Scott. Come try on your computer science hats!. rsscott2@asu.edu.

keefer
Download Presentation

Intel Ultimate

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Intel Ultimate Engineering Experience

  2. Introductions

  3. Come on in, the code is GREAT! Instructors I sure do love making mobile apps! Brad Nichols Michael Katic michaelkatic@gmail.com • bnichols@spsu.edu Ryan Scott Come try on your computer science hats! rsscott2@asu.edu Feel free to contact any of us for whatever reasonIf 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!

  4. Who speaks computer?

  5. Facebook • Join us on Facebook • And Wikispaces!

  6. What is Programming? • Computer Programming is the: • Designing • Writing • Testing • Debugging • and Maintaining • of source code of computer programs.

  7. Why do I want to be a computer Programmer? • Pay • Starting Salaries in computer programming range from $59,000 to $112,000 per year • Contract jobs run as high as $100 to $400 per hour • Flexibility & Independence • Work from home as freelance contractor • Nearly always able to work from home • Bring your work anywhere • The “Do good work and we wont ask questions” policy • Demand & Job Security • As long as society relies on computing technology, there will be a demand for computer programmers. Notes from: http://www.indeed.com/ http://www.askitcareercoach.com/ http://smallbusiness.chron.com/advantages-being-computer-programmer-38637.html

  8. Course Schedule

  9. Hello WoRld Time to get started

  10. Hello World Tutorial General Structure of a C# Program Main() and Command-Line Arguments Hello, World! class Program { staticvoid Main(string[] args)     { Console.WriteLine("Hello, World!");     } } TIP:Don’t forget to add Console.ReadKey(true); to stop the console window from closing.

  11. Programming Basics

  12. //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 as a note to whomever reads the code.

  13. More on Types Types and Variables Declaration of a Variable intx; The line above creates a new variable named “x” of type int Initialization of a Variable x = 5; This line set our variable “x” to the value 5 Accessing a Variable intz = x; This accesses the value assigned to variable “x” and assigns it to the value of the variable “z”

  14. More on Operators 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. int x = 5; int y = 6; Console.WriteLine(x + y); String x = 5; String y = 6; Console.WriteLine(x + y); 11 56

  15. Conditional Operators • < less than • > greater than • <= less than or equal to • >= greater than or equal to • == equal to • != not equal to • && logical and • || logical or Examples

  16. More on if else Conditional Statements (If else) bool result = true; //What happens when you change true to false. if (result) { Console.WriteLine("The variable is set to true."); } else{ Console.WriteLine("The variable is set to false."); }

  17. More on switch If else vs. switch statements If else statement Switch Statement switch(number) { case1: // Print 1 break; case2: // Print 2 break; default: // Print number break; } if (number == 1){ // Print 1 } elseif (number == 2){ // Print 2 } else{ // Print number }

  18. More on while loop Learning Loops int n = 1; while (n < 6) { Console.WriteLine("Current value of n is " + n);     n++; } Current value of n is 1 Current value of n is 2 Current value of n is 3 Current value of n is 4 Current value of n is 5

  19. Methods/Functions

  20. More on Methods 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. Dont 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.

  21. Method Example The method below returns true when it is given an input of “0” otherwise it returns false. boolisZero(intval) { if (val == 0)     { returntrue;     } else    { returnfalse; } }

  22. 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; boolxCheck; boolyCheck; xCheck = isZero(x); //xCheck is now set to true yCheck = isZero(y); //yCheck is now set to false

  23. Classes/Objects

  24. Classes animal.cs Main() Animal myAnimal = newAnimal(); Console.WriteLine(myAnimal.name); Console.WriteLine(myAnimal.weight + Pounds); myAnimal.Eat(); Console.WriteLine(myAnimal.weight + Pounds); Ryan 10 125 weight++; Eat() Ryan 125 Pounds 126 Pounds Note: “weight++” is equivalent to “weight = weight + 1”

  25. INHERITANCE Dog.cs Main() Pug Dog myDog = newDog(); Console.WriteLine(myDog.breed); myDog.breed = DalmationConsole.WriteLine(myDog.breed); Console.WriteLine(myDog.age); Ryan 10 125 weight++; Eat() Pug Dalmation 10

  26. More on Random Class More on Random.Next() Random (number Generator) Class Represents a pseudo-random number generator, a device that produces a sequence of numbers that meet certain statistical requirements for randomness. Random numGen = new Random(); randNum = numGen.Next(0, 3); //Sets randNum to either 0, 1, or 2 Inclusive Lower Bound Exclusive Upper Bound

  27. 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

  28. 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 

  29. Intel Ultimate Engineering Experience

More Related