CST112 Midterm Exam

NOTES:

  • Modularize fully:
            i.e. no I/O or calculations in the event handlers.
  • Be sure to begin each sub or function with a comment.
  • Do not use "ByRef".
  • Do not use any "global" data.
  • Do not modify any text that was typed into a textbox by the user.
You must upload the files for this exam this exam to your folder tonite, to receive credit. Use the following file names (using your intials instead of XYZ):
  • XYZmidterm.vb
  • XYZmidterm.Designer.vb
You must upload the files for the "takehome" exam by November 11th.
  • XYZtakehome.vb
  • XYZtakehome.Designer.vb


    First, create a VB form with the following "controls":
  • A large, centered label at the top, displaying YOUR initials and the words "CST112 Midterm" (or "Takehome").
  • A label at the lower-left corner of the form, displaying your full name.
  • Five (textbox) inputs labelled Monday, Tuesday, Wednesday, Thursday, and Friday.
  • Another (textbox) input labelled "Rate".
  • A listbox for multi-line output.
  • Buttons and click-event handlers, as described below.
         (No I/O or calculations in handlers; use subs or functions for all I/O and calculation.)

  1. Add the following four buttons, to calculate employee pay and output the result (in dollars). In each case, calculate the adjusted number of hours, and then calculate the pay with "overtime" pay at "time-and-a-half" for all hours over 40. Adjust the total hours before calculating the pay (but do NOT change the textboxes).
    1. When the "REGULAR" button is clicked, total up the number of hours and calculate the pay.
    2. When the "MON. HOL." button is clicked, if the number of hours worked on Monday was zero, then add eight (8) paid hours for Monday (but do NOT change the input display).
    3. When the "ELECTION" button is clicked, add two paid hours if any hours were worked on Tuesday.
    4. When the "XMAS" button is clicked, if at least four (4.0) full hours were worked on Friday, then add four (4) more paid hours.
    Do not modify any text that was typed into a textbox by the user.
    (It is not necessary to explain how hours were adjusted; just say "Your pay is: $.....". )

  2. Add a "REPORT" button to calculate the following values and output each of them (with descrtiptive text, saying what's what):
    1. Actual number of hours worked this week. (Just add up the five days!)
    2. Average number of hours worked per day. (Just divide the total by five.)
    3. Number of days on which this employee worked more than eight hours.
    4. Name of the day on which the employee worked the smallest number of hours, but NOT zero.

  3. Add the following buttons:
    1. "MWF" to change the label color to (any shade of) GREEN for Monday, Wednesday, and Friday, and change the labels to (any shade of) RED for Tuesday and Thursday.
    2. "TT" to change the label color to (any shade of) GREEN for Tuesday and Thursday and change the labels to (any shade of) RED for Monday, Wednesday, and Friday.
    3. "SAME" to change all label colors to YELLOW.
    4. "RESET" to clear all inputs (but do not clear output).
    5. "CLEAR" to clear the output area (but do not clear inputs).
    6. "EXIT" to quit the form.