Homework
Provide a brief definition of the following terms (in the interface
programming context):
- Subroutine
- "Handle an event"
- Control structure
- Boolean
- Concatenate
- Operator
If you use a source (book or web site), cite your source. (The sites
http://whatis.techtarget.com/ and http://www.webopedia.com/ are decent
sources for technical definitions.)
Salary Calculator
SalaryCalculator.exe
- Design a form that allows the user to enter the name, hourly wage and number of
hour worked for an employee.
- When the button is clicked the program should calculate the weekly salary of the
employee and make the text for a check in the textbox below.
- Use a Try-Catch statement to make sure the user has entered numbers for the hours
and the wage. Pop up a messagebox (and exit the subroutine) if the user
- does not enter a number.
- If the hourly wage is below Minimum Wage (let's use $5.85), a messagebox should
appear indicating the problem.
- If the user enters a negative number for the number of hours, a message box should
appear indicating the problem.
- If the employee worked more than 40 hours, he or she should receive time and
a half for the hours exceeding 40. For example if one works 36 hours at
$6.00 an hour, one will receive 216 = 36*6 dollars; but if one works 44 hours at
$6.00 an hour, one will receive 276 = 40*6 + (44-40)*6*1.5 dollars.
- Clear out the "check" area if the user changes any of the information above.
- The "check" above is a multiline TextBox.
- The date was written using the code Now.Date
- To move to a the beginning of a new line, concatenate the constant
VbCrLf (Visual Basic Carriage Return Line Feed) to the string.
- For a tab, use the constant VbTab.
- Suppose Salary is a variable holding an amount of money to be paid
to an employee. You can use the code Format(Salary,"Currency")
to print out the number in a way that looks like money.
Due: Sept. 10