Programming

TouchDevelop


TouchDevelop is a unique programming environment because it allows you to develop software on a Windows Phone 7 or Windows Phone 8 smartphone. You can also develop on any web platform using the TouchDevelop web app.

Download software: Windows Phone 7 or 8: download from the Windows Marketplace or Store app on your phone. Access the web development environment at http://www.touchdevelop.com.

Cost: Free

Instructions to setup software: Will install automatically on a Windows Phone or just run the web app from any PC internet browser. (Yes, even Safari on a Mac.) You will need a Microsoft Account to fully use this tool. Windows Phone users already have a Microsoft Account.


TRY IT! (Instructions for http://www.touchdevelop.com)

1. Open the TouchDevelop web site and log in with your Microsoft account. Once you log in, the web page will look something like this.

touchdevelop-1

2. There are lots of help files and tutorials right on the web page. They are a great resource as you learn to create programs with this system.

3. To create a new script, click on the Create Script tile. You’ll be brought to this screen:

touchdevelop-2

4. Select the blank app. Type the name ‘BSA Temperature Converter’ into the dialog that appears and click create. You see this screen appear.

touchdevelop-3

5. Now you are ready to create the code for your app.

6. Click on the word ‘main’ in the code editor. A list of options will appear on the left hand side.

touchdevelop-4

7. Click on the ‘add input parameter’ plus sign to create your temperature input. A parameter ‘P: Number’ will appear between the parentheses be the word main. Click on the P and you can change the name.

touchdevelop-5

8. Now that you’ve created the variable that you’ll use to enter the temperature, it’s time to create the constants and equation to calculate the Celsius temperature. To start, click in the do section where it says ‘do nothing.’

touchdevelop-6

9. A virtual keypad will come up with options that you can add to the program that you are writing.

touchdevelop-7

10. To create your variables click on the var button and create the variable ‘Factor’. Set it equal to 5/9. Click on the plus sign in the circle just below the variable that you just created and create another variable ‘Constant’ and set that equal to 32.

touchdevelop-8

11. Then create a third variable Celsius. Use the keypad options to set Celsius equal to (Factor * Degrees Fahrenheit) – Constant

touchdevelop-9

12. This is the core of the program. It will now calculate the temperature in Celsius when given the temperature in Degrees Fahrenheit. Continue using the editor to create the rest of the program.

touchdevelop-10

13. To create the response lines, create a new line like you have before. Then click on the left parentheses, type a double quotation mark and enter your text. Then click on the button with the two vertical lines, ‘||’, add the Celsius variable, then click on the ‘||’ button again and add the rest of the text.

touchdevelop-11

When you run the program in a web browser, it will look like this.

touchdevelop-13

The arrow button returns to the TouchDevelop web page and the button at the top on the right resets the program so that you can try several conversions without having to restart the program. Enter a temperature and click the OK Button to see the result. Try several different temperatures.


ABOUT THE PROGRAM — A WALK THROUGH

1. The action main() function

a. Obtains the value entered in the Input Textbox.
b. The value is converted to Celsius (with a single decimal place).
c. The Celsius value is evaluated with a series of IF Statements and a suggested action phrase is posted to the display area which is called the wall.
d. A sentence is created by combining or “concatenating” some static text along with the temperature values (deg F and Deg C) and the action phrase.


TRY THIS

1. Change the temperatures used in the decisions – change the lower temperature from 60 to 30 degrees, for example. Save the file, restart the program, and enter new numbers – did the answers change at the new temperature?

2. Create a new temperature range from 30 to 60 degrees and have it display – “Bring hat and gloves!”

3. Change the wording of the phrases

4. Add another text input – ask for the wind speed, for example

5. Add some conditional statements that evaluate the wind chill factor

6. Add some text to display the wind chill result


LEARN MORE

http://www.touchdevelop.com has tutorials and help files to help you learn this language.

Comments about “TouchDevelop”

  1. firedragon says:

    I have an account on this

Write a comment about “TouchDevelop”

Nickname:

Type your comment:

  • 1. Safety. Do the following:
      a. Show your counselor your current, up-to-date Cyber Chip.
      b. Discuss first aid and prevention for the types of injuries or illnesses that could occur during programming activities, including repetitive stress injuries and eyestrain.

    2. History. Do the following:
      a. Give a brief history of programming, including at least three milestones related to the advancement or development of programming.
      b. Describe the evolution of programming methods and how they have improved over time.

    3. General knowledge. Do the following:
      a. Create a list of 10 popular programming languages in use today and describe which industry or industries they are primarily used in and why.
      b. Describe three different programmed devices you rely on every day.

    4. Intellectual property. Do the following:
      a. Explain how software patents and copyrights protect a programmer.
      b. Describe the difference between licensing and owning software.
      c. Describe the differences between freeware, open source, and commercial software, and why it is important to respect the terms of use of each.

    5. Projects. Do the following:
      a. With your counselor’s approval, choose a sample program. Then, as a minimum, modify the code or add a function or subprogram to it. Debug and demonstrate the modified program to your counselor.
      b. With your counselor’s approval, choose a second programming language and development environment, different from those used for requirement 5a and in a different industry from 5a. Then write, debug, and demonstrate a functioning program to your counselor, using that language and environment.
      c. With your counselor’s approval, choose a third programming language and development environment, different from those used for requirements 5a and 5b and in a different industry from 5a or 5b. Then write, debug, and demonstrate a functioning program to your counselor, using that language and environment.
      d. Explain how the programs you wrote for requirements 5a, 5b, and 5c process inputs, how they make decisions based on those inputs, and how they provide outputs based on the decision making.

    6. Careers. Find out about three career opportunities in programming. Pick one and find out the education, training, and experience required. Discuss this with your counselor and explain why this career might be of interest to you.

  • Earning the Cyber Chip can help you learn how to stay safe while you are online and using social networks or the latest electronic gadgets.

    Topics include cell phone use, texting, blogging, gaming, cyberbullying, and identity theft. Find out more about the Cyber Chip at www.scouting.org/cyberchip.