Question: I need assistance!! im using Python and I was able to create the requested for loop structure for my assignment, but I ' m having
I need assistance!! im using Python and I was able to create the requested for loop structure for my assignment, but Im having some trouble with creating a recursive structure. Any guideance would be great!
Develop two algorithms, one based on a for loop structure and the other on a recursive structure, to print the daily salary of a worker who each day is paid twice the previous day's dalarystarting from a penny for the first day's work for a day period.
numofdays intinputEnter number of days worked:
totalsal
salary
printDay Pay"
for i in range numofdays:
ifnumofdays :
salary i
salary salary
totalsal salary
print $formati salary
print
Total Salary for", numofdays, "days is: $:fformattotalsal
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
