I'm a newbie to the programming field and I really need help to understand what i'm doing wrong. This is the exercise i'm working on I need to create an application that allows the users to enter the number of pennies in a jar. The application then calculates the number of dollars, quarters, dimes, nickles, and pennies that he will receive when he cashes in the pennies. Any guidance would be greatly appreciated.
MsBarnes
This is the codes that I have started off with:
Option Explicit On
Option Strict On
Public Class MainForm
Private Sub xExitButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xExitButton.Click
Me.Close()
End Sub
Private Sub xCalculateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles xCalculateButton.Click
' calculate the total number of coins return
' declare variables
Dim num As Integer
Dim dollar As Integer
Dim quarter As Integer
Dim dime As Integer
Dim nickle As Integer
Dim penny As Integer
' calculate and display the amount of coins
Integer.TryParse(Me.xamountTextBox.Text, num)
Integer.TryParse(Me.xDollarTextBox.Text, dollar)
dollar = num \ 100
Integer.TryParse(Me.xQuarterTextBox.Text, quarter)
quarter = num Mod 100 \ 25
Integer.TryParse(Me.xDimeTextBox.Text, dime)
dime = num Mod 100 \ 10
Integer.TryParse(Me.xNickleTextBox.Text, nickle)
nickle = num Mod 100 \ 5
Integer.TryParse(Me.xPennyTextBox.Text, penny)
penny = num Mod 100 \ 1
End Sub
Private Sub xClearButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xClearButton.Click
' prepare the screen for the next amount
Me.xamountTextBox.Text = String.Empty
Me.xDollarTextBox.Text = String.Empty
Me.xQuarterTextBox.Text = String.Empty
Me.xDimeTextBox.Text = String.Empty
Me.xNickleTextBox.Text = String.Empty
Me.xPennyTextBox.Text = String.Empty
End Sub
End Class