Chapter 8
Computing Using Math
IN THIS CHAPTER
Using math operations
Getting fancy with advanced operations
Modding, ordering, and rounding numbers
Coding a crypto code breaker
Math operations consist of everything from adding and multiplying to using exponents. This chapter helps you gain proficiency in working with math operations, coaching you in how you can use these computational tools in your computer programs. For example, your coder can write code that uses math to find the average of a group of test scores, or figure out whether a number is even or odd, or pick random numbers for a dice roll.
Acting Out Math, Unplugged
Math is something you use every day. You figure out how many quarts of paint you need to cover all four walls of your room. You divide dog bones to make sure each beagle and corgi gets his fair share. You compute a tip to reward the pizza delivery person for getting that large pepperoni to you fast and hot (see Figure 8-1). Speaking of fast and hot, fast is determined by a number — a relative quantity of time; and hot is determined by a temperature.
Get Helping Kids with Coding For Dummies now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.