1. Write Visual Basic statements that accomplish each of the following tasks:
A. Display the message “Hello” in resultTextBox
B. Assign the product hourlySalary and hoursWorked to variable earnings
C. State that a program performs a sample payroll calculation (that is, use text that helps to document a
program).
2. (Average Calculator Application) Write an application that takes three numbers as input in TextBoxes,
stores the three integers in variables, then calculates and displays the average of the numbers. The
output is displayed in a label.
a. Creating the application. Create a new Windows Forms application named Average-Calculator.
Rename its form1.vb file as AverageCalculator.vb. Set the Form’s Font property to Segoe UI 9pt
and its Text property to Average Calculator.
b. Coding the Click event handler. Perform the average calculation in the Calculate Button’s Click
event handler. Display the average in the resultLabel.
c. Clearing the result. Write event handlers for the TextBoxes’ TextChanged events. Write code to
clear resultLabel after the user enters new input into any of the TextBoxes.
d. Running the application. Select Debug> Start Debugging to run your application. Enter three
integers, then verify that the average is calculated properly.
3. (Table of Powers Application) Write an application that displays a table of numbers from 1 to an upper
limit, along with each number’s squared value (for example, the number n to the power 2, or n ^ 2) and
cubed value (the number n to the power 3, or n ^ 3). The user specifies the upper limit, and the results
are displayed in a ListBox.
4. (Wage Calculator with Tax Calculations) Develop an application that calculates an employee’s
earnings. The user should provide the hourly wage and number of hours worked per week. When the
Calculate Button is clicked, the employee’s gross earnings should display in the Gross earnings:
TextBox. The Less FWT: TextBox should display the amount deducted for federal taxes and the Net
earnings: TextBox should display the difference between the gross earnings and the federal tax
amount. You can use the format specifier C with String method Format, to format the result as
currency. Assume that overtime is calculated for hours over 40 hours worked, overtime wages are 1.5
times the hourly wage and federal taxes are 15% of gross earnings. The Clear Button should clear all
fields. Set the TextAlign properties of the Labels that show the results to MiddleRight so that the
values are aligned at their decimal points. Don’t use the data type Decimal for Calculations.