Write a program that calculates the amount a person would earn over a period of time if his or her salary were one penny the first day, two pennies the second day, and so on doubling each day.
Your program should:
1. Request the number of days.
2. Display a table showing what the salary is for each day
3. Display the total pay
And for the life of me, I can't figure it out and it's starting to annoy me. Any thoughts? The end program should output this:
I'm not exactly sure what function I need to be using or what values I need to be using to make it work. Either my loop would go crazy and never stop sending back results or it would just give me a single result of zero. So, I'm pretty confused right now. :/