This assignment will assess your basic knowledge and use of flowcharts. While there are several different symbols to support building a flowchart, use the attached basic flowchart symbols.
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.
Submission Instructions:
Make sure each submission is labeled with the following:
Your Name
Course Name, Section (example: ENTD200 B002 Spr15)
Instructor name
Week #
Date completed
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:
"""
Your Name
Course Name, Section (example: ENTD200 B002 Spr18)
Instructor name
Week #
Date completed
notes
"""
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="">
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
Submission Instructions:
Use variable names related to the task, do not use single-letter variables. Comment/organize your code for easy reading and maintenance,
The file name for both flowcharts should be Week3_4_{yourlastname}.ppt, do not include the braces as part of the name.
for payroll code
Week3_4_P1_{yourlastname}.py
for MPG code
Week3_4_P2_{yourlastname}.py
DO NOT SAVE WORD FILES or PPT files as .py
Hints:
The
given/input
is listing the required inputs, and
display/output
is 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)