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

Lecture 9: CSCI E-1 Spring 2013

Lecture 9: CSCI E-1 Spring 2013

Tommy MacWilliam

April 24, 2013
Tweet

More Decks by Tommy MacWilliam

Other Decks in Education

Transcript

  1. Computer Science E-1
    Lecture 9: Programming

    View full-size slide

  2. Final Project

    View full-size slide

  3. http://cse1.net/store

    View full-size slide

  4. What chair is everyone sitting in?

    View full-size slide

  5. 1. Ask the person to your left where he/she is
    sitting
    2. If there is no one to your left,
    say “one”
    3. Add one to the answer of the person
    to your left, and say it out loud

    View full-size slide

  6. How many people are here?

    View full-size slide

  7. 1. Stand up. You are number 1.
    2. Pair off with someone standing. Add your
    numbers together. The sum is your new number.
    3. One person sits. The other goes to step 2.

    View full-size slide

  8. How do you make a peanut butter
    and jelly sandwich?

    View full-size slide

  9. Boolean expressions

    View full-size slide

  10. Combining expressions

    View full-size slide

  11. alert(‘O hai, world!’);

    View full-size slide

  12. var socks_on_feet = 0;

    View full-size slide

  13. if (socks_on_feet == 2) {
    alert(‘Done!’);
    }
    else {
    alert(‘Keep going!’);
    }

    View full-size slide

  14. var counter = 0;
    while (counter < 10) {
    alert(counter);
    counter = counter + 1;
    }

    View full-size slide

  15. var counter = 0;
    while (counter < 10) {
    alert(counter);
    counter++;
    }

    View full-size slide

  16. for (var i = 0; i < 10; i++) {
    alert(i);
    }

    View full-size slide



  17. Web Page


    A web page!


    View full-size slide

  18. html
    head body

    View full-size slide

  19. html
    head body
    title

    View full-size slide

  20. html
    head body
    title h1
    span

    View full-size slide

  21. document.getElementById

    View full-size slide

  22. document.querySelectorAll

    View full-size slide

  23. Thanks!
    Ben, R.J., Chris, Dan, Ramon

    View full-size slide

  24. Computer Science E-1
    Lecture 9: Programming

    View full-size slide