You are on page 1of 4

Back to Content

Week 3 / 4 Assignment
Instructions
Week 3&4
 
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 = 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)
Enter employee Name -> Al Bunday
Enter hours worked -> 35
Enter hourly rate  -> 7.25
Al Bunday:  35.0 * 7.25 = 253.75
 
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.
 
Week3_4_P1_{yourlastname}.py for payroll code
Week3_4_P2_{yourlastname}.py for MPG code

Hints:

1. The given/input is listing the required inputs,


and display/output is listing the required outputs.
2. 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)
 

Assignment Rubric:

Accomplished Developing Beginning Poi


Assessment Rubric
Ava

Assignment details Student Student Student 10


in a comment block. effectively partially failed to
completed the completed complete
Create a comment
assignment. the the
block as instructed assignment. assignment.
Create flowcharts as Student Student Student 20
instructed  effectively partially failed to
completed the completed complete
assignment. the the
assignment. assignment.

Logic and print Student Student Student 60


function used to effectively partially failed to
correctly print the completed the completed complete
solution to Python assignment. the the
Problems  assignment. assignment.

Code organization Student Student Student 10


and comments effectively partially failed to
completed the completed complete
assignment. the the
assignment. assignment.

Total 100

Week3_Adding_two_numb… (21.73 MB)

Week3_Adding_two_numb… (55.47 KB)

Week3_examples.pptx (42.42 KB)


Week4_IDLE.mp4 (20.54 MB)

Week4_Python Batch.docx (15.76 KB)

Week4_Tutorial.docx (22.3 KB)

Week4_Using_python.mp4 (31.72 MB)

You might also like