Week 5 Project
Write 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, four pennies the third day, and continues to double each day. Output the amount earned each day .. and the total pay at the end.
The Algorithm (Plan) for your program would be:
Ask the user for the number of days to be worked
Verify that the amount entered is positive, and if not, continue to ask the fuser or an amount ..until a valid number is entered
For each day worked
Calculate the pay
Print out the pay
Add the daily pay to the final total
Print out the final total of pennies
Print out the final total in dollars and cents form
SAMPLE OUTPUT would look like:
How many days will you work? -5
Please reenter .. days must be positive -10
Please reenter .. days must be positive 0
Please reenter .. days must be positive 16
Day 1 : 1 pennies
Day 2 : 2 pennies
Day 3 : 4 pennies
Day 4 : 8 pennies
Day 5 : 16 pennies
Day 6 : 32 pennies
Day 7 : 64 pennies
Day 8 : 128 pennies
Day 9 : 256 pennies
Day 10 : 512 pennies
Day 11 : 1024 pennies
Day 12 : 2048 pennies
Day 13 : 4096 pennies
Day 14 : 8192 pennies
Day 15 : 16384 pennies
Day 16 : 32768 pennies
Total amount earned 65535 pennies
or ..655 dollars and 35 cents
please go threw code and output .
please follow indentation while copying code.
CODE:
def countWork(days):
totalEarn = 1
i = 1
temp =2
for i in
range(days):
print "Day %(first)d : %(second)d Pennies"% {"first": i,
"second":totalEarn}
temp += temp*i;
totalEarn = totalEarn*2
return totalEarn-1
def main():
days = input("How many
days will you work?")
while True:
if(days > 0):
break
else:
days=input("Please reenter .. days must be positive")
countWork(days)
total =
countWork(days)
doller=total/100
pennies =
total%100
print("Total amount
earned %(first)d pennies"% {"first":total})
print("or ..%(first)d
doller and %(second)d cents"%{"first":doller,
"second":pennies})
main()
OUTPUT:

Week 5 Project Write a program that calculates the amount of money a person would earn...
Project 5 - intro to python Write a program in python 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, four pennies the third day, and continues to double each day. Output the amount earned each day .. and the total pay at the end. The Algorithm (Plan) for your program would be: Ask the user for the...
Write a program using Python 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, then show the total pay at the end of the period. The output should be displayed...
Using Javascript! Write 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...
Python Computer Programming Write 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, then show the total pay at the end of the period. The output should be...
Show Me The Money. (15 points) Write a C++ program that calculates how much a person earns in a month if the salary is one penny the first day, two pennies the second day, four pennies the third day, and so on, with the daily pay doubling each day the employee works. The program should ask the user for the number of days the employee worked during the month and should display a table showing how much the salary was...
Write a Java program that calculates how much a person would earn after a period of time, according to the following rules: 1. The starting salary for the first day is $1. 2. The salary will double each day. Ask the user to input the number of days worked. The output should display how much the salary was for each day worked, and show the total pay at the end of the work period. Get output similar to the sample...
In Python. Write a program that will calculate the amount of money a person would earn over a period of time if his/her salary is one penny the first day and two pennies for the second day, and continue to double each day. Hints: Declare variables Get the number of days from the user. Show the salary table for each day 4. Use ‘for loop’ to loop through the range of days (1, num_days +1) 5. Display the total pay...
In 80x86 assembly language Write a program that calculates how much a person earns in a month if the salary is one penny the first day, two pennies the second day, four pennies the third day, and so on with the daily pay doubling each day the employee works. The program should ask the user for the number of days the employee worked during the month, validate that it is between 1 and 31, and then display a table showing...
Write a program that calculates the amount a person would earn over a 30-day period of time if his/her salary is one penny the first day, two pennies the second day, and continues to double each day. The program should display a table showing the salary 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. A sample output might look...
HTML only Design and implement 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 daysdisplay a table showing what the salary was for each daythen show the total pay at the end of the period.The output should be displayed in the...