Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Scratch 1.4: Beginner's Guide

You're reading from   Scratch 1.4: Beginner's Guide Learn to program while creating interactive stories, games, and multimedia projects using Scratch

Arrow left icon
Product type Paperback
Published in Jul 2009
Publisher Packt
ISBN-13 9781847196767
Length 264 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Chapter 8. Math and Finance

If I offered you $15,000 or one dollar that doubled every day for 30 days, which one would you choose? By the time we finish the chapter, you'll know if you've chosen wisely.

We'll use the Indian folktale by Demi, "One Grain of Rice," to inspire our project and to demonstrate the power of doubling. In the folktale, a village girl asks a greedy king to double a single grain of rice each day for thirty days as a way to accumulate enough rice to feed the hungry villagers.

In this chapter, we will illustrate the math behind the folktale and compare it to conventional interest-based accrual methods. Specifically, we will:

  • Calculate the total amount of money if we double a dollar each day

  • Collect user input via slider input controls

  • Graph the results of a calculation using the pen and stamp tools

  • Build interactive math problems using variables

  • Calculate simple interest on an amount of money

I'm using dollars as the basis for my project, but the math works whether we use euros...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image