Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to Programming

Introduction to Programming

In our every day life, we use a lot of computer software. Have you ever wondered how this software is created and wanted to understand more about what programming is?

Swathi Kantharaja

May 03, 2014
Tweet

More Decks by Swathi Kantharaja

Other Decks in Programming

Transcript

  1. Find if a given number is even Take the given

    number, and divide it by 2 IF the remainder is 0, THEN the number is even Or ELSE, the number is odd. Is 584 an even number? Is 211 an even number? Is 1024 an even number?
  2. Make me a sandwich Take 2 slices of bread Place

    meat or vegetables on one half Place some salad on this Place a slice of cheese on this Cover this with the other half of the bread
  3. Syntax & Semantics Syntax is the structure or form of

    a language Semantics is the meaning
  4. Arrays [ , , , ] “Oxford Street” “Old Street”

    “Tottenham Court Road” … [ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  5. Hashes [ , , , ] “Oxford Street” “Old Street”

    “Tottenham Court Road” … { “Zone 1”: , “Zone 2”: , … } [ , , ] “Camden Town” “Kentish Town” …
  6. Conditionals if stations[“Zone 1”].include?( ) … do something for Zone

    1 … else … do something for non - Zone 1 … end “Oxford Street”
  7. Loops i = 1 while i <= n … do

    something ’n’ times … i = i + 1 end