Question
The following form will be used to determine the sales commission of employees. Using Visual Studio, build the form with these features: The checkbox Target
The following form will be used to determine the sales commission of employees. Using Visual Studio, build the form with these features:
The checkbox Target Met must be disabled.
The title of the form should appear as Sales Commissions
Write the code to do the following: After entering the totals sales, the checkbox will automatically be checked if the average sales per month was $1,500 or more.
Note: The average sales per month can be calculated by dividing (total sales/months).
When the Determine Sales Commission button is clicked, the program must first check that there is no bad data entered into the textboxes. This means:
Employees name must be entered.
Both months and total sales must be numbers.
The number of months entered must be between 0-12.
Total sales must be a positive number. Any other data entered should result in showing an error message.
a. Write the code for the data validation as described above.
b. After that, input data from the textboxes into created variables. Do not forget to convert the data to its appropriate datatype as needed.
Under the same button Determine Sales Commission, and after the data validation from Q3, write the code that shows the following in the list box:
The name of the employee.
Number of months worked.
Total sales.
Average sales per month (Calculated as Total Sales / Months)
A message about meeting the target, for example: Target Met or Target Not met This is based on the criteria of having average sales per month = $1,500 or more.
a. Under the same button, and after the code you completed for Q4, call a function named GetCommission. This function will receive the months and total sales, and returns the dollar amount of the employees commission to be added into the listbox.
b. Next, create the function GetCommission which received number of months and total sales, and returns the commission. (30) If target was not met, the commission will be 5% of all sales. Otherwise, the commission is calculated as 10% of the amount that met the target plus 15% of all additional sales. Mathematical Equations:
a. Target not met: Commission = 0.05 x TotalSales
b. Target met: Commission = (months x 1,500 x 0.10) + (0.15 x (TotalSales (months x 1,500)))
Write the code for the clear button that:
Clears all textboxes.
Clears the checkbox.
Clears the listbox
Places the cursor in the first text box Employees Name
Sales Commissions Emplyee's Name Number of Working Months Toal Sales S$ [][]0 Target Mt Detemine Sales Commission Clear Employees Name XxX Months Worked 4 Total Sales $7,000.00 Average Sales Per Month$1.750.00 Target Met Commission$750.00 Sales Commissions Emplyee's Name Number of Working Months Toal Sales S$ [][]0 Target Mt Detemine Sales Commission Clear Employees Name XxX Months Worked 4 Total Sales $7,000.00 Average Sales Per Month$1.750.00 Target Met Commission$750.00Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started