Feb 18, 2015 at 5:42pm UTC
Hey guys! I'm having difficulty with a part of my program. I am instructed to make a table using a loop. The table should look like.
Days Pay Amount
1 0.01
2 0.02
3 0.04
4 0.08
5 0.16
6 0.32
7 0.64
8 1.28
9 2.56
10 5.12
11 10.24
12 20.48
13 40.96
14 81.92
15 163.84
16 327.68
17 655.36
18 1310.72
19 2621.44
20 5242.88
21 10485.76
22 20971.52
23 41943.04
24 83886.08
25 167772.16
26 335544.32
27 671088.64
28 1342177.28
29 2684354.56
30 5368709.12
Would I use a "for" loop? Or how would I go about starting something like this?
Last edited on Feb 18, 2015 at 5:44pm UTC
Feb 18, 2015 at 6:09pm UTC
any loop can be used here..
Feb 18, 2015 at 6:20pm UTC
Ah, okay. I'm just struggling with how to make the days and pay amount go up. The pay doubles everyday, while the day obviously increases by 1. I guess that's the part I'm having the most difficulty on.