Salespeople for used cars are compensated using a commission system. The commission is based on the cost incurred for the vehicle:

Commissions = Commission rate * (Sales price Cost value)

The form will allow the user to enter the salespersons name, the selling price of the vehicle, and the cost value of the vehicle. Use a constant of 20 percent for the commission rate.

1. Start a new project and call it ICE2

2. The final form will look like the following: see image.

3. Object and property settings:

  • frmMain
    • Name frmMain
    • AcceptButton btnCalculate
    • CancelButton btnExit
    • Text VB Auto Center
    • StartPosition CenterScreen
  • GroupBox1
    • Text Used Auto Sale Commission
  • Label1
    • AutoSize False
    • Text Name:
    • TextAlign TopRight
  • Label2
    • AutoSize False
    • Text Selling Price:
    • TextAlign TopRight
  • Label3
    • AutoSize False
    • Text Cost Value:
    • TextAlign TopRight
  • txtName
    • Name txtName
  • txtSellingPrice
    • Name txtSellingPrice
  • txtCostValue
    • Name txtCostValue
  • Label4
    • AutoSize False
    • Text Commission:
    • TextAlign MiddleRight
  • lblCommission
    • Name lblCommission
    • AutoSize False
    • BorderStyle Fixed3D
    • Text Should be empty
    • TextAlign MiddleLeft
  • btnCalculate
    • Name btnCalculate
    • Text Calculate
  • btnClear
    • Name btnClear
    • Text C&lear
  • btnExit
    • Name btnExit
    • Name E&xit

4. Event Procedures:

btnCalculate_Click

  • Declare constant variable.
  • Declare local variable used in calculation.
  • Within a Try/Catch Block
    • Attempt to convert input selling price (i.e. use CDec function).
    • Attempt to convert input cost value (i.e. use CDec function).
  • Calculate the commission.
  • Display the commission.

btnClear_Click

  • Clear the text boxes.
  • Clear the calculated commission.
  • Set the focus to the first textbox.

btnExit_Click

  • Close the application.

5. Other Requirements:

a. Try to make sure that the labels and textboxes inside the group box are aligned and evenly spaced as shown in the picture above.

b. Try to make sure the buttons are all the same size and horizontally spaced. The first and last buttons should be aligned with the edges of the group box.

c. Make sure that when a user Tabs through the form that it follows the path of Name, Selling Price, Cost Value, Calculate, Clear and finally Exit.

d. Once you are done with the final design of the form layout then lock all the controls.

e. In the code add the following comment lines above the Public Class frmMain line

i. Project: ICE#2
ii. Programmer: < your name>
iii. Date: < date completed>
iv. Description: Used car sales commission calculator for salesperson

f. You can use just one Try/Catch block. In the Catch portion use a MessageBox to display an error message that says, Selling price or cost value must be numeric.

g. The calculated commission should be displayed as currency with two decimal places. A sample output would look like the following: see image.

h. Each procedure should have comments

i. Follows all our other MIS 328 coding standards.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.