C HELP PLEASE ='[
this is my code so far:
my output should look something like this DAY PAY TOTAL 1 0.01 0.01 2 0.02 0.03 3 0.04 0.07 4 0.08 0.15 5 0.16 0.31 6 0.32 0.63 7 0.64 1.27 8 1.28 2.55 9 2.56 5.11 10 5.12 10.23 i need help with the total please =/ if pay is pay*=2 oh would i type something like that for total_pay
There are a few differences from my suggested solution and your example. This includes using a zero based index and the use of the += operator for your total pay variable.
for clarity you might have wanted to use several loops but if this is necessary then use total_pay +=pay instead of total_pay*=2
i spotted another little problem with the code, what if the date is larger than 31 days? the program will simply exit, should it at least say why or preferably loop back for a better answer perhaps? (of course this is not to initiate feature creep)
thank you guys so much =] very helpful
Join our real-time social learning platform and learn together with your friends!