You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is an old tale about a king who offered a servant $10,000 as a reward. The servant instead asked that for 30 days he be given an amount that would double, starting with a penny. (1 penny for the first day, 2 for the second, 4 for the third, then 8, 16, 32 pennies, and so on).
Use for loops to answer the following:
How much was the reward after 30 days?
remember, a penny isn't 1, but 0.01
Bonus (Only If You Have Time):
How many days would it take the servant to make $10,000?
How about 1 billion?
In JavaScript, there is a value Infinity . How many days until the servant has infinite money?