Problem 1: Simple payroll calculation. Calculate the amount of pay, given/inputs employee name (first, last), hours worked,
Question:
Problem 1: Simple payroll calculation. Calculate the amount of pay, given/inputs employee name (first, last), hours worked, and hourly rate. The formula to calculate payroll is pay = 100 + (hourly rate * hours worked.) Display/outputs employee name, hourly rate, hours worked, and pay. (Do not add any features such as overtime, bonus, taxes, insurance, ...)
Problem 2: Calculate the average miles per gallon obtained on a trip. Given/inputs vehicle name, trip name, the amount of gas used, gas price, and the number of miles driven. (The formula to calculate miles per gallon is miles per gallon = number of miles driven / amount of gas used.) Display/outputs vehicle name, trip name, gas used, miles driven, gas price, and MPG.
Part I
Create a flowchart for each of the above problems. Use flowchart symbols to illustrate how you would complete your program. You may use Microsoft PowerPoint (preferred) or Microsoft Word for your flowchart.
Use your own values to test the flow. The values should not be part of the flowchart. The flowchart is a blueprint for any programming language and for a wide range of input values.
Part II
Create a Python program for each problem described above.
Create a comment block for each Python code(starts at line 1 of your code) with the following information:
Sample output (Payroll)
Employee Name -> Al Bunday
Enter hours worked -> 35
Enter hourly rate -> 7.25
Al Bunday: <<< Make sure to apply the formula in the assignment
Sample output (MPG)
Enter Car Name -> Dodge
Enter Trip Name -> Supermarket
Enter Miles driven -> 50
Enter Gas used -> 5
Enter Gallon price -> 3.5
Dodge:
Trip name: Supermarket
Miles driven 50.0
Gas used: 5.0
Fuel cost: 17.5
MPG: 10.0
Hints:
- Thegiven/inputis listing the required inputs, anddisplay/outputis listing the required outputs.
- You can hardcode values (see below) or use input()
# The code below is not acceptable
print("2 + 5 = 7")
# This is an acceptable code
fnum=2
snum=5
sum=fnum+snum
print(fnum,"+",snum,"=",sum)
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill