Make a program that calculates the amount of money a person


1. Pennies Doubled

Make a 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 program should ask the user for the number of days. Display a table showing what the salary was for each day, and then show the total pay at the end of the period. The output should be displayed in a dollar amount, not the number of pennies.

For example, if the user entered 10 days, your program will display the earnings for each day up to and including the 10th day. The output would be as follows:

Day 1: $0.01

Day 2: 0.02

Day 3: 0.04

Day 4: 0.08

Day 5: 0.16

Day 6: 0.32

Day 7: 0.64

Day 8: 1.28

Day 9: 2.56

Day 10: 5.12

Total earnings: $10.23

Note: The user should be able to perform as many calculations desired without re-executing the program.

Make use of both the 'while' and 'for' loops in your logic.

Solution Preview :

Prepared by a verified Expert
Business Management: Make a program that calculates the amount of money a person
Reference No:- TGS02569669

Now Priced at $10 (50% Discount)

Recommended (97%)

Rated (4.9/5)