help with a loop

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
any loop can be used here..
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.
Topic archived. No new replies allowed.