"""
Joshua Miller
pennyaday.py 8-1
"""
"""
col #1 - day
col #2 - day pay
col #3 - to date pay
Design & write a python program that calculates the amount of money a person would earn over a period of time if his or her salary is one penny the first day, two pennies the second day and continues to double each day.
The only input to the program should be the number of days to calculate. The day number, amount of pay for each day and the accumulated amount of pay should be stored in a two dimensional array and the results printed from that array.
The output should be displayed in a dollar amounts, not the number of pennies.
A minimum of three modules should be used for this problem.
Hint: Each day of work would be represented by a row. Column 1 would be the day count, column 2 the current day's pay and column 3 the accumulated pay.
**Use comments to document the python program
"""
from isNumeric import *
from numpy import *
def main():
days = raw_input("How many days would you like to calculate for this? ")
days = int(days)
pay = zeros([days,3],float)
pay = calculate(days,pay)
print pay
outputScreen(days,pay)
def calculate(days, pay):
pay[0,0] = 1
pay[0,1] = 0.01
pay[0,2] = 0.01
for i in range(1,days,1):
pay[i,0]= i+1
pay[i,1] = pay[i-1,1] * 2
pay[i,2] = pay[i-1,2] + pay[i,1]
return pay
def outputScreen(days,pay):
print "#1 #2 #3 "
for i in range(0,days,1):
print pay[i,0], " ", pay[i,1], " ", pay[i,2]
if __name__ == "__main__":
main()