Students should view the provided Block Program.
- What new features have been added to this program that did not exist in the last program?
U4Ch1L2_Variables Investigate
Purpose: Students investigate three working examples of apps that make use of variables.
Activity: Level #1: Thermostat App. V.1_
- Play with the App! - What does it do?
- Based on the Javascript skills that you have recently acquired, try to write the program for how the Blue & Red buttons work with a variable to present the changing temperature. Refer to past lessons for guidance. Write it on the front board.
Activity: Level #2: Thermostat App. V.2_This Activity shows the actual program for the Thermostat App.
- Students should compare their program to the actual program.
- Half the Groups should study Section 1: Lines 1-12, and the other half Section 1: Lines 14-21.
- Delete the space in between the quotation marks and the letter "F" in line 4. How does this change what is displayed on the screen?
- Present: Match opposite Groups. Have them explain to the other groups what their lines of code do.
- Finally, Rewrite the program so that it changes by 5 degrees each time the button is clicked.
Activity: Level #3: Thermostat App.
- Students should view the provided Block Program.
- What new features have been added to this program that did not exist in the last program? (converted to celcius and rounded up.)
Activity: Level #4: Thermostat App.
- This is the same program seen in Level 3, but now you can run it and see if your prediction came true.
- tempF, tempC, tempDisplayF, tempDisplayC - What are you observing?
- Do This:
- How does “Math.round” work? Delete it from lines #3, #15 and #28. What happened?
- Delete the space in between the quotation marks and the letter "F" in line 4. How does this change what is displayed on the screen?
Activity: Level #5: Thermostat App.
- Students should play with the provided Thermostat App.
- What new features have been added to this program that did not exist in the last program? (Name required for Log in. Name placed on Screen 2 while using App.)
Activity: Level #6: Thermostat _This is the program for the App. above.
- Do This:
- Investigate the code for this new version of the Thermostat App. What's changed? What's been added?
- What's happening on line 40? Hover over the getText() block in the toolbox to read its documentation.
- On Line 41, what happens when you add an exclamation point "!" to the end of the string stored in username