My name is Dianne Coleman and I am working on some homework. I have written the code but it is not running. What I would like someone to do for me is to tell me what I haven't done. I don't want you to write the code for me just let me know what I am missing so that I can fix it. This is how I learn. I am using VB 2008 Express.
'Project name: Pennies Project ' Project purpose: The project calculates the total number of pennies into dollars, quarters, dimes, nickels and pennies ' when taken to the bank. ' Created/revised: Dianne P. Coleman on 14 June 2009 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 xCalcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles xCalcButton.Click 'Calculate the pennies into dollars, quarters, dimes, nickles 'declare variables Dim amountOwed, amountPaid, changeDue As Decimal Dim dollarChange As Integer Dim quarterChange As Integer Dim dimeChange As Integer Dim nickelChange As Integer Dim pennyChange As Integer Dim intTotal As Integer 'assign value to variables amountOwed = Decimal.Parse(Me.xChangeLabel.Text) amountPaid = Decimal.Parse(Me.xPaidTextBox.Text) 'perform calculations changeDue = amountPaid - amountOwed dollarChange = intTotal \ 100 intTotal = intTotal Mod 100 quarterChange = intTotal \ 25 intTotal = intTotal Mod 25 dimeChange = intTotal \ 10 intTotal = intTotal Mod 10 nickelChange = intTotal \ 5 intTotal = intTotal Mod 5 pennyChange = intTotal \ 1 intTotal = intTotal Mod 1 'display total amounts in controls Me.xChangeLabel.Text = Convert.ToString(changeDue) Me.xDollarLabel.Text = Convert.ToString(dollarChange) Me.xQuarterLabel.Text = Convert.ToString(quarterChange) Me.xDimeLabel.Text = Convert.ToString(dimeChange) Me.xNickelLabel.Text = Convert.ToString(nickelChange) Me.xPennyLabel.Text = Convert.ToString(pennyChange) Me.xChangeLabel.Text = Format(changeDue, "currency") 'send focus to the clear form Me.xOwedTextBox.Focus() End Sub End Class

New Topic/Question
Reply




MultiQuote





|