Presentation is loading. Please wait.

Presentation is loading. Please wait.

Tour de Programming Five Day Race. Overview Day One: Everyday is a new day Day One: Everyday is a new day –If this and if that: making change Day Two:

Similar presentations


Presentation on theme: "Tour de Programming Five Day Race. Overview Day One: Everyday is a new day Day One: Everyday is a new day –If this and if that: making change Day Two:"— Presentation transcript:

1 Tour de Programming Five Day Race

2 Overview Day One: Everyday is a new day Day One: Everyday is a new day –If this and if that: making change Day Two: A little history Day Two: A little history –A few variables: guessing numbers Day Three: Know it all Day Three: Know it all –Arrays: student registration Day Four: Now you see it, now you don’t Day Four: Now you see it, now you don’t –“div”s: simple game Day Five: Point and click Day Five: Point and click –“onclicks”: big keypad

3 Dialogue Days 1, 2 and 3 use dialogue.htm and dialogue.js. Days 1, 2 and 3 use dialogue.htm and dialogue.js.dialogue.htm dialogue.jsdialogue.htm dialogue.js Create a separate folder for each day. Create a separate folder for each day. Copy dialogue.htm and dialogue.js into each folder. Copy dialogue.htm and dialogue.js into each folder. No need to change dialogue.htm, except to add your name and score sheet to the top of the body. No need to change dialogue.htm, except to add your name and score sheet to the top of the body. Edit dialogue.js to complete the programming exercise. Edit dialogue.js to complete the programming exercise.

4 Day by Day Everyday, you will create a folder with your login name and the letter “P” and a sequence number n (e.g. yorkjP1). Everyday, you will create a folder with your login name and the letter “P” and a sequence number n (e.g. yorkjP1). At the end of every day, copy (copy, not move) all your program folders into this new folder. At the end of every day, copy (copy, not move) all your program folders into this new folder. Drop the new folder into the drop box. Drop the new folder into the drop box. You can work on the programming exercises in any order and you can go back to add something or fix something in any exercise. You can work on the programming exercises in any order and you can go back to add something or fix something in any exercise. Your code should not look like anyone else’s! Your code should not look like anyone else’s!

5 Day 1: Everyday is a new day If this and if that: MAKING CHANGE If this and if that: MAKING CHANGE The goal of this exercise is to make change for a dollar. The goal of this exercise is to make change for a dollar. If the user enters 47, the program responds with “2 quarters and 3 pennies.” If the user enters 47, the program responds with “2 quarters and 3 pennies.” The program should return the minimum number of coins. The program should return the minimum number of coins. This program uses all the operators (ch. 2), if statements (pg. 32, 34), parseInt (pg. 84). This program uses all the operators (ch. 2), if statements (pg. 32, 34), parseInt (pg. 84).

6 Scoring for Making Change Correct change in pennies: 15/25 Correct change in pennies: 15/25 Correct change in pennies & nickels: 16/25 Correct change in pennies & nickels: 16/25 Correct change in pennies, nickels & quarters: 18/25 Correct change in pennies, nickels & quarters: 18/25 Correct change in pennies, nickels, dimes & quarters: 20/25 Correct change in pennies, nickels, dimes & quarters: 20/25 Correct change for a twenty dollar bill: +2 points. Correct change for a twenty dollar bill: +2 points. “1 dime” and “2 dimes”: +2 points “1 dime” and “2 dimes”: +2 points Ability to enter both amount paid and price: +2 points Ability to enter both amount paid and price: +2 points Accepting amounts as decimals (e.g. 0.47 instead of 47): +2 points – use math functions on pg 69 & 70. Accepting amounts as decimals (e.g. 0.47 instead of 47): +2 points – use math functions on pg 69 & 70. Cash register: +2 points Cash register: +2 points

7 Day 2: A little history A few variables: GUESSING NUMBERS A few variables: GUESSING NUMBERS The goal of this exercise is to guess the number the user has selected. The goal of this exercise is to guess the number the user has selected. For example, the computer might guess 9 and the user would respond “higher,” “lower,” or “yes.” For example, the computer might guess 9 and the user would respond “higher,” “lower,” or “yes.” This program uses a few variables to remember previous guesses and answers, such as var must_be_higher_than, must_be_lower_than. This program uses a few variables to remember previous guesses and answers, such as var must_be_higher_than, must_be_lower_than. No need to change dialogue.htm, except to add your name and score sheet to the top of the body. No need to change dialogue.htm, except to add your name and score sheet to the top of the body. Edit dialogue.js to complete the programming exercise. Edit dialogue.js to complete the programming exercise.

8 Scoring for Guessing Numbers Guessing between 1 and 10 in 10 guesses or less: 15/25 Guessing between 1 and 10 in 10 guesses or less: 15/25 Guessing between 1 and 99 in 20 guesses or less: 18/25 Guessing between 1 and 99 in 20 guesses or less: 18/25 Guessing between 1 and 1000 in 10 guesses or less: 20/25 Guessing between 1 and 1000 in 10 guesses or less: 20/25 Guessing between 1 and N, where user enters N: +2 points. Guessing between 1 and N, where user enters N: +2 points. Guessing between M and N, where user enters M and N : +2 points Guessing between M and N, where user enters M and N : +2 points Accepting hints “odd” or “even”: +2 points Accepting hints “odd” or “even”: +2 points Accepting hint “divisible by N”: +2 points. Accepting hint “divisible by N”: +2 points. Change from “Is your number 16?” to “Your number is 16” when you know the answer: +2 points Change from “Is your number 16?” to “Your number is 16” when you know the answer: +2 points

9 Day Three: Know it all Arrays: STUDENT REGISTRATION Arrays: STUDENT REGISTRATION The goal is to register students in a class with a fixed number of seats. The goal is to register students in a class with a fixed number of seats. The program uses arrays to represent seats. name[i] might be the name of the student in seat i, empty[i] is true if the seat is empty, id[i] is the student’s id, etc. The program uses arrays to represent seats. name[i] might be the name of the student in seat i, empty[i] is true if the seat is empty, id[i] is the student’s id, etc. The program can use two word “action object” commands like the dialogue example. The program can use two word “action object” commands like the dialogue example. No need to change dialogue.htm, except to add your name and score sheet to the top of the body. No need to change dialogue.htm, except to add your name and score sheet to the top of the body. Edit dialogue.js to complete the programming exercise. Edit dialogue.js to complete the programming exercise.

10 Scoring for Student Registration Add Michael, Add Jasmine … until class is full: 15/25 Add Michael, Add Jasmine … until class is full: 15/25 Detect when an added student is already in the class: 16/25 Detect when an added student is already in the class: 16/25 Add and drop actions: 18/25 Add and drop actions: 18/25 Report number of students and number of free seats after every action: 20/25 Report number of students and number of free seats after every action: 20/25 Case independence (actions and objects): +2 points. Case independence (actions and objects): +2 points. Accepting number of seats from user: +2 points Accepting number of seats from user: +2 points Assign each new student a numeric id and program action Whois number: +2 points Assign each new student a numeric id and program action Whois number: +2 points Let drop work with drop name or drop id: +2 points. Let drop work with drop name or drop id: +2 points. Add action report class that alerts students and their ids: +2 points Add action report class that alerts students and their ids: +2 points

11 Alphabet Days 4 and 5 use day4.htm, day5.htm and day4.js, day5.js. Days 4 and 5 use day4.htm, day5.htm and day4.js, day5.js.day4.htmday5.htmday4.js day5.jsday4.htmday5.htmday4.js day5.js Create a separate folder for each day. Create a separate folder for each day. Copy alphabet.htm and alphabet.js into each folder. Copy alphabet.htm and alphabet.js into each folder. No need to change alphabet.htm, except to add your name and score sheet to the top of the body. No need to change alphabet.htm, except to add your name and score sheet to the top of the body. For various creative reasons, you might want to change the content of the “div”s. For various creative reasons, you might want to change the content of the “div”s. Edit alphabet.js to complete the programming exercise. Edit alphabet.js to complete the programming exercise.

12 Day 4: Now you see it, now you don’t “div”s: SIMPLE WORD GAME “div”s: SIMPLE WORD GAME The goal is to have the user turn off letters until they are all gone. The goal is to have the user turn off letters until they are all gone. The user enters words and the program turns off all the letters in the word. The user enters words and the program turns off all the letters in the word. When the last letter is turned off, the game reports the number of words needed. When the last letter is turned off, the game reports the number of words needed. No need to change alphabet.htm, except to add your name and score sheet to the top of the body. No need to change alphabet.htm, except to add your name and score sheet to the top of the body. Edit alphabet.js to complete the programming exercise. Edit alphabet.js to complete the programming exercise.

13 Scoring for Simple Word Game Entering letters one at a time: 15/25 Entering letters one at a time: 15/25 Entering words one at time: 18/25 Entering words one at time: 18/25 Entering many words at a time: 20/25 Entering many words at a time: 20/25 Case independence (actions and words): +2 points. Case independence (actions and words): +2 points. Add action restart: +2 points Add action restart: +2 points Add action reverse word that turns letters on instead of off: +2 points Add action reverse word that turns letters on instead of off: +2 points Add action random N that starts each game with N random letters on the board: +2 points. Add action random N that starts each game with N random letters on the board: +2 points. Add “high scorer” function to remember and report the high scorer’s name and score: +2 points Add “high scorer” function to remember and report the high scorer’s name and score: +2 points

14 Day Five: Point and click “onclicks”: BIG KEYPAD word. “onclicks”: BIG KEYPAD word. The goal is to use the letter array as a keypad input device. The goal is to use the letter array as a keypad input device. No need to change alphabet.htm, except to add your name and score sheet to the top of the body. No need to change alphabet.htm, except to add your name and score sheet to the top of the body. Edit alphabet.js to complete the programming exercise. Edit alphabet.js to complete the programming exercise.

15 Scoring for Big Key Pad Each time a letter is clicked, add it to the user input field: 15/25 Each time a letter is clicked, add it to the user input field: 15/25 Use the big keypad to control any simple program to show that keypad input is equivalent to keyboard input: 20/25 Use the big keypad to control any simple program to show that keypad input is equivalent to keyboard input: 20/25 Hard-coded macros – define a few keys to input a fixed string of letters each time they are clicked: +2 points. Hard-coded macros – define a few keys to input a fixed string of letters each time they are clicked: +2 points. Soft-coded macros – let the user define the value for macro keys (e.g. A = alphabet): +2 points [This could be the simple program.] Soft-coded macros – let the user define the value for macro keys (e.g. A = alphabet): +2 points [This could be the simple program.] Change the graphics for the macro keys: +2 points Change the graphics for the macro keys: +2 points Add delete key: +2 points. Add delete key: +2 points. Let the user define one keypad key to be a go key (e.g. A = go): +2 points Let the user define one keypad key to be a go key (e.g. A = go): +2 points


Download ppt "Tour de Programming Five Day Race. Overview Day One: Everyday is a new day Day One: Everyday is a new day –If this and if that: making change Day Two:"

Similar presentations


Ads by Google