CSC 110 ASSIGNMENT 312/9/2018

Name______1

Coding Assignment #3

Check List

 / Create Task List and define flowchart symbols
 / Draw flowchart and add pseudocode
 / Draw the user interface, place the names on the form,use the names in the problem
 / Fill out object property sheet
 / Code problem
 / Print code
 / Comments Be sure to add as many as you think will make the code easy to update
  • Create a Windows project with the name your initials + Payroll (e.g. DBPayroll).
  • Change the name property of the default form to frmPayroll.
  • Change the text property of the form to Hourly Payroll to display in the title.
  • Add label controls to your form and change the contents of the text properties as follows (see image below, use the correct prefixes, points will be taken off if not used):
  • Name
  • Date
  • Hours Worked
  • Hourly Wage
  • Payroll Details
  • Gross Pay
  • Federal Tax
  • FICA
  • State Tax
  • Retirement
  • Net Pay
  • Add the following text boxes next to their corresponding labels (see image below). Change the name as indicated below, text property to empty string, the font to bold and forecolor to blue. Change the text alignment to right for the txtHours and txtWage text boxes.
  • txtName
  • txtDate
  • txtHours
  • txtWage
  • Add the following label controls to be use as output of payroll calculations. Be sure to change the name property as indicated below, text property to empty string, change the background color to white and the backcolor to white, forecolor to red, font to bold, borderstyle to Fixed3D, and textalign to MiddleCenter.
  • lblGross
  • lblFederal
  • lblFICA
  • lblState
  • lblRetire
  • lblNet
  • Add a command button and change the name property cmdCompute, in the text property enter &Compute. Write code in that object’s Click event to compute the payroll results and display them appropriately where the gross pay is equal to the hours * wage. Below are the percentages for the deductions. Be sure to declare all arguments locally and initialize their values. (What variable type should be use?)
  • Federal-20 %
  • FICA- 8 %
  • State- 5 %
  • Retirement-10 %
  • Test your work and compare to the results on the following page.

  • Change your calculation for the Gross pay so that employees earn time and ½ for any hours worked over 40 (i.e. if a person works 41 hours, 40 hours would be at the regular wage and the additional 1 hour would be at 1 ½ times the regular wage). Below is a sample with a person working 41 hours. Use the appropriate condition statement for your calculation.

  • Add code that checks to make sure all data is entered appropriately prior to performing the payroll computation (i.e. there must be some text in the Name and Date textboxes and the values in the Hours Worked and Hourly Wage textboxes must be greater than zero). If something is not entered correctly, display an appropriate message to the user and do not perform the computation.
  • Add a reset button named cmdReset that clears all user input and payroll calculations when clicked.
  • Add an Exit button named cmdExit that will close the window.
  • The final form should look like the following: