Converting Pennies into Dollars (Visual Basic)

  Uncategorised

Working on some homework
New to coding

Given an amount of money in cents, I need to convert the amount into the format of dollars, quarters, dimes, nickels, and pennies. For Example 1234 cents should output 12 dollars, 0 quarters, 3 dimes, 0 nickels, and 4 pennies.

This is what I have so far.
The math is really tripping me up.

Public Class Form1
Private Sub BtnCalculate_Click(sender As Object, e As EventArgs) Handles BtnCalculate.Click
Dim Amount, Total, Dollars, Quarters, Dimes, Nickels, Pennies As Double

    Amount = TextBox1.Text
    Total = Amount * 0.01
    Dollars = Total  1
    Quarters = 
    Dimes = 
    Nickels = 
    Pennies = 

    Label13.Text = Pennies
    Label11.Text = Nickels
    Label9.Text = Dimes
    Label7.Text = Quarters
    Label5.Text = Dollars
    Label3.Text = Total
End Sub

Private Sub BtnExit_Click(sender As Object, e As EventArgs) Handles BtnExit.Click
    Close()
End Sub

End Class

Any feedback, recommendations or comments will help!

Source: Visual Studio Questions

LEAVE A COMMENT