introduction to touchdevelop math basic arithmetic operations disclaimer: this document is provided...

5
introduction to touchdevelo math basic arithmetic operations Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and Windows Live are trademarks of the Microsoft group of companies. All other trademarks are property of their respective owners.

Upload: octavia-powers

Post on 22-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to touchdevelop math basic arithmetic operations Disclaimer: This document is provided “as-is”. Information and views expressed in this document,

introduction to touchdevelop

mathbasic arithmetic operations

Disclaimer: This document is provided “as-is”. Information and views expressed in this document, including URL and other Internet Web site references, may change without notice. You bear the risk of using it. This document does not provide you with any legal rights to any intellectual property in any Microsoft product. You may copy and use this document for your internal, reference purposes. © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and Windows Live are trademarks of the Microsoft group of companies. All other trademarks are property of their respective owners.

Page 2: Introduction to touchdevelop math basic arithmetic operations Disclaimer: This document is provided “as-is”. Information and views expressed in this document,

introduction to touchdevelop

numbers,+,*,…o use the arithmetic pad

to enter +, -, /, *o use the number pad to

enter numberso more in math.o floating point numbers

like your calculator

✿ double precision

Page 3: Introduction to touchdevelop math basic arithmetic operations Disclaimer: This document is provided “as-is”. Information and views expressed in this document,

introduction to touchdevelop

matho scientific calculator services

• trigonometry: sin, cos, acos, …

• calculus: pow, √, loge, log10,…

• constants: π(pi), g(ravity),…

• numerics: floor, ceil, round,…

• useful: random,…

✿ https://www.touchdevelop.com/help/api/200060/math

Page 4: Introduction to touchdevelop math basic arithmetic operations Disclaimer: This document is provided “as-is”. Information and views expressed in this document,

introduction to touchdevelop

user inputo use wall→ask number to get a number

from the user

var x := wall→ask number(“enter x”)x →post to wall

☀ you can also add arguments to the action

Page 5: Introduction to touchdevelop math basic arithmetic operations Disclaimer: This document is provided “as-is”. Information and views expressed in this document,

introduction to touchdevelop

exercisesouse a different action for each exercise

► “compute the square root, i.e. √(x), of x given by the user”

► “compute the surface of a rectangle with its width and height from the user”

► “compute the root of ax + b, given a and b from the user”

► “compute the surface of a circle given the radius from the user”