Week 8 Assignment: Lists Instructions: You will complete thisassignment in Python 3.x. Make sure you have downloaded thesoftware, and it is installed correctly. You will download it fromthis site: https://www.python.org/downloads/. You will code thefollowing and submit it in one file. Use the information in theLessons area for this week to assist you. Save it as a python file(.py), and upload it into the Assignments area.
• Create a comment block (starts at line 1 in the code) with thefollowing information:
“”” DRU Barr
ENTD200 D004
Professor Mortoza Abdullah
Week 8
26 November 2019 “””
Optional 2 Modify the Payroll and/or the MPG program fromweek5/6 to store the results in a list/dictionary.
Print the list/dictionary when no more calculation isselected.
The output will be something like this for the payroll
Payroll for week xyz
James Bond ……. 21,500
Al Bundy ……. 500
Johnny English ….. 1,200
Total Payroll ……. 23,200
For the MPG will be something like
MPG for zyz truck
Week 1 ….. 12
Week 2 ….. 33
Week 3 ….. 27
MPG Ave ….. 24
WEEK 5 PSUEDOCODE FOR PAYROLL
#step 1:- call main function
#step 2:- main function call paycheck
#step 3:- paycheck input hours and hourly rate and printpaycheck
#step 4:- program ask for more calculation
# if input == ‘Yes’ then repeat step 2 to 4
# if input ==‘No’ program displays Thank you message
# else exit program
def paycheck():
hoursWorked = int(input(‘Please enter hours worked :’))
paycheck = int(input(‘Please enter hourly rate ofpay : ‘))
print(‘Paycheck:${:d}’.format(hoursWorked*payRate))
def TY():
print(‘Thank you using Payroll Calculator’)
def main():
cal = ‘Yes’
cal = ‘No’
paycheck()
cal = input(‘Would you like to enter anything else?Yes or No’)
if(cal == ‘yes’ or cal ==‘Yes’):
main()
if(cal ==‘no’ or cal==‘No’):
TY()
else:
return
if __name__ == “__main__”:
print(‘PAYROLL CALCULATION’)
main()
WEEK 5 PSEUDOCODE FOR MPG
#step 1:- call main function
#step 2:- main function call MPG
#step 3:- MPG input miles driven and gallons used and printMPG
#step 4:- program ask for more calculation
# if input == ‘Y’ then repeat step 2 to 4
# if input ==‘No’ program displays Thank you message
# else exit program
def MPG():
gallonsUsed = int(input(‘ Please enter number ofGallons used : ‘))
milesDriven = int(input(‘Please enter number ofmiles driven : ‘))
MPG = MilesDriven/ gallonsUsed
print(‘MPG: {:.2f}’.format(MPG))
def TY():
print(‘Thank you using MPG Calculator’)
def main():
cal = ‘Yes’
cal = ‘No’
milesPerGallon()
cal = input(‘Would you like to enter anything else?Yes or No ‘)
if(cal == ‘y’ or cal ==’Y’):
main()
if(cal ==‘no’ or cal==‘No’):
TY()
else:
return
if __name__ == “__main__”:
print(‘MPG’)
main()
***Please make it easy to copy and paste if possibly. THANKYOU!!!****
Expert Answer
Answer to Week 8 Assignment: Lists Instructions: You will complete this assignment in Python 3.x. Make sure you have downloaded th…