Question
Intro to Python, chapter 4, Interface Design: An employee has a strange way of being paid. On the first day of work, they are only
Intro to Python, chapter 4, Interface Design:
An employee has a strange way of being paid. On the first day of work, they are only paid one penny. But on the second day they are paid 2 pennies, and on the third day they are paid 4 pennies, and on the fourth day, they are paid 8 pennies. Their pay rate doubles every day in this manner.
Write a program that asks the user for the number of days to calculate. It will then print a table of what the employee would get paid for each day, and at the end, it will show what the total pay would be. A picture is attached for your reference. This program will make use of for loops, and an accumulator. You should also have a variable for the pay rate - you will need to double the value of this variable for each day. You must have a "main" function.
Grading:
Program compiles with no syntax errors: 12 points
Program does what it's supposed to do: 5 points
You have meaningful comments: 3 points
You should have a multiline comment at the top to describe what the program does
You should have comments that describe what your functions do
You should have comments in your program wherever else would be useful to the reader of your code.
Output:
24862486248 5 12486248612499863748 u000013625 -50001375012 5 0 0 0 0 0 0 0 12 1248625124 136362 4 125 0 a 01234567890Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started