Timesheet Calculator Assignment

From Knowledge Kitchen
Jump to: navigation, search


Background story

Here’s the scenario: you are hired in a student job (i.e. cheap labor) stacking silverware in NYU's Hayden Dining Hall for which you are paid the same rate as all dining hall employees, but without the benefits.  Being entrepreneurial at heart, you think up a scheme to make more money using your newly acquired (but potentially lucrative) programming skills.

Your job

You will create a timesheet program for the dining hall that asks the manager to enter the hours worked for a given employee.  Then you’ll sell this program to the dining hall manager for a commission of 3% of every employee’s wages.  The program uses the hours entered to automatically calculate a given employee’s wages and it also automatically displays how much of those wages are owed to you (i.e., how much of that money is your 3% commission).  Of course, the program must subtract your commission from the total employee’s wages.

Note: dining hall employees make $5/hr regular time and $10/hr for overtime (i.e. more than 40 hours per week), and this program should, of course, be able to calculate that.

Sample input

Example user responses are in green:

Enter employee name (last name, first name): Jokelson, Elliot 
Enter week start date (dd/mm/yyyy): 01/30/2014
Hours worked Sunday:  8
Hours worked Monday:  8
Hours worked Tuesday:   8
Hours worked Wednesday: 8
Hours worked Thursday:  10
Hours worked Friday:    8
Hours worked Saturday:  8

Sample output

  • you must line up the columns of data so that they are visually easier to read using (see string formatting examples here)
  • the numbers displayed here are placeholder only, and are intentionally not correct calculations
 Jokelson, Elliot - Employee Compensation Record
 For week beginning 01/30/2014
 -------------------------------------------------------
 Total regular hours (not including overtime):     40
 Total regular compensation (@ $5/hr):           $200
 Total overtime hours:                             18
 Total overtime compensation (@ $10/hr):         $135
 -------------------------------------------------------
 Total commission to [your name here] (3%):       $16.80
 Total employee compensation:                     $443.20


What links here