Amount of change

PLEASE HELP!!!!!!

I have an application that calculates the amount of

change that is owed to a customer. The problem is:

I need to know the number of dollars, number of quarters, number of dimes, number of nickels, and

the number of pennies owed to the customer. I can't

seem to figure out the code that will return this information. PLEASE HELP!!!!!!!


Comments

  • : PLEASE HELP!!!!!!

    : I have an application that calculates the amount of

    : change that is owed to a customer. The problem is:

    : I need to know the number of dollars, number of quarters, number of dimes, number of nickels, and

    : the number of pennies owed to the customer. I can't

    : seem to figure out the code that will return this information. PLEASE HELP!!!!!!!

    Private Sub Command1_Click()

    Dim x As Integer

    Dim y As Integer

    Dim Count_Coins As Integer

    ReDim w(1 To 3) As Currency

    Dim Due_Customer As Currency

    Dim Coins As Currency

    Dim Coins_Remaining As Currency

    Due_Customer = txt_Monies_Rcvd - txt_Tot_CGS

    'Dollars: Everything to left of decimal

    lbl_Dollars = Format(Due_Customer - Right(Due_Customer, 3))

    'Coins: Everything to right of decimal

    Coins = Right(Due_Customer, 2)

    'Define Coins_Remaining

    Coins_Remaining = Coins

    'Quarters, Nickels, Dimes

    y = 25

    For x = 1 To 3

    Count_Coins = 0

    Do While Coins_Remaining > y

    If Coins_Remaining < y Then Exit Do

    Coins_Remaining = Coins_Remaining - y

    Count_Coins = Count_Coins + 1

    Loop

    w(x) = Count_Coins

    If x = 1 Then y = 10 Else y = 5

    Next

    lbl_Quarters = w(1)

    lbl_Dimes = w(2)

    lbl_Nickels = w(3)

    'Pennies

    lbl_Pennies = Coins_Remaining

    End Sub




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories