Saturday
October 25, 2014

Homework Help: Visual Basic

Posted by Reese on Friday, February 25, 2011 at 3:52pm.

Alright, so I'm trying to code a program to where I can plug in two numbers and get a commission cost out of them.

I'm having a hard time setting up the code, and I'm really looking for some guidance. I have this as the code so far:

Public Class Form1
'Declare module-lvel variables and constants
Private SellingPriceInteger, CostValueInteger As Integer
Const COMMISSION_RATE_Decimal As Decimal = 0.2D
Private Sub PrintButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintButton.Click
'Prints the Form.
PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
PrintForm1.Print()
End Sub
Private Sub CalculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculateButton.Click
'Calculates the Comission
Dim SalesPriceInteger As Integer, CostValueInteger As Integer
Dim COMMISSION_RATE_Decimal As Decimal = 0.2D

Try
'Convert quantity to numeric variable.
SalesPriceInteger = Integer.Parse(SPTextBox.Text)
Catch ex As Exception

End Try

Try
'Convert price if quantity was successful.

Catch ex As Exception

End Try
End Sub
End Class

Basically, I'm in need of some guidance when it comes to Try/Catch, along with figuring out if what I'm typing would work, or if I'm missing a code that defines Integer.

Answer this Question

First Name:
School Subject:
Answer:

Related Questions

Programming - Here is the question that I need help to write the code for the ...
Programming (Visual Basic) - Im seem to be having trouble with this Exercise. ...
Ms Visio - 2. Construct a data dictionary and draw a hierarchy chart and ...
visual basic - in visual basic, notes in a program which explain what the ...
Programming - Read two numbers from the keyboard Display the menu options as ...
Visual Basic - Help with code Enter 10000 for total sales Base pay cont $900. ...
visual basic - in visual basic, a routine that puts a series of strings or ...
visual basic programming - Write a Visual Basic program that will calculate the...
Programming - I need your help to write a program using visual basic 2010 for ...
PROGRAMMING - PLS, I NEED TO BE GUIDED ON HOW TO WRITE A SIMPLE PROGRAM IN BASIC...

Search
Members