Tech Today Online

Go Back   Tech Today Online > Knowledge Base > Ask the Experts


Reply
 
LinkBack Thread Tools Display Modes
Old 03-11-2011, 11:01 AM   #1
Junior Member
 
Join Date: Sep 2010
Location: NC
Posts: 9
Roxy is on a distinguished road
Default Visual Basic help

I am taking Visual Basic this semester and have understood everything up until now. We are using Radio Buttons, Check Buttons, If then Else, and message boxes.
The problem is to create a project to compute your checking account balance. Include radio buttons for: deposit, checking, service charge. A text box to allow the user to enter the amount of the transaction. Display the new balance in a ReadOnly text box. Display a Message box if the new balance would be a negative number. If there is not enough money to cover a check, do not deduct the check amount. Instead display a message box with the message "Insufficint funds" and deduct a service chharge of $10. Add a Summary button that will display the total number of deposits, the total dollar amount of the checks. Do not include checks that were returned for insufficient funds, but do include the service charges. Use a message box to display the summary information.
Ok, here is my code, but it does not work. What am I doing wrong?


[Option Strict On
Option Explicit On
Public Class CheckingAccountForm
'Declare Module variables.
Private DepositTransDecimal, CheckTransDecimal As Decimal
Private DepositCounterInteger, CheckCounterInteger As Integer
Const SERVICE_CHARGE_Decimal As Decimal = 10D

Private Sub PrintButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintButton.Click
'Print the form to preview.

PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
PrintForm1.Print()

End Sub

Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
'Close the program

Me.Close()

End Sub

Private Sub ClearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ClearButton.Click
'Clear the transactions.
AmtofTransTextBox.Clear()

End Sub

Private Sub CalculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculateButton.Click
'Declare the variables.

Dim AmtTransDecimal, AcctTransDecimal, BalDecimal, TotalServChgDecimal, ServChgDecimal As Decimal

Try
AcctTransDecimal = Decimal.Parse(AmtofTransTextBox.Text)
If DepositRadioButton.Checked Then
DepositTransDecimal = AmtTransDecimal
BalDecimal += DepositTransDecimal
DepositCounterInteger += 1
ElseIf CheckRadioButton.Checked Then
CheckTransDecimal = AmtTransDecimal
End If
If BalDecimal < AmtTransDecimal Then
MessageBox.Show("Insufficient Funds")

Else
End If

BalDecimal = AmtTransDecimal
If ServieChargeRadioButton.Checked Then
BalDecimal = AmtTransDecimal
ServChgDecimal = AmtTransDecimal
If ServieChargeRadioButton.Checked Then
TotalServChgDecimal = AmtTransDecimal

End If

End If


Catch ex As Exception


End Try
End Sub
End Class[/CODE]
Any help will be appreciated.

__________________
Members don't see ads in threads. Register your free account today and become a member on Tech Today Online, gaining access to posting privileges, contests, free plug-ins and other downloads, unlimited online storage for your photographs, reviews, free marketplace listings, and much more.
Roxy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Share on Facebook
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 05:26 PM.