•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the VB.NET section within the Software Development category of DaniWeb, a massive community of 375,174 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,225 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our VB.NET advertiser:
Views: 3618 | Replies: 2
![]() |
•
•
Join Date: Oct 2005
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
I need help in my VB class making a cash register. I know I'm supposed to use modulus and integer functions as well as nested if's, but am having a hard time coding it. If you haven't figured it out yet, this is my first real attempt at coding in VB.
Here's the assignment:
You must create an application that determines the most efficent change to be given from a one dollar bill. The change should be given in terms of quarters, pennies, nickels, and dimes.
Here's the assignment:
You must create an application that determines the most efficent change to be given from a one dollar bill. The change should be given in terms of quarters, pennies, nickels, and dimes.
•
•
•
•
Originally Posted by CHUDMASTER
I need help in my VB class making a cash register. I know I'm supposed to use modulus and integer functions as well as nested if's, but am having a hard time coding it. If you haven't figured it out yet, this is my first real attempt at coding in VB.
Here's the assignment:
You must create an application that determines the most efficent change to be given from a one dollar bill. The change should be given in terms of quarters, pennies, nickels, and dimes.
Very interesting, VB 6 or .Net??
•
•
Join Date: Oct 2005
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
I'm looking for VB.Net....here's what I have so far but I seriously doubt it's even close to being right.........
Private Sub btnChange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChange.Click
Dim Cash As Integer
Const Pennies As Integer = 0.01
Const Quarters As Integer = 0.25
Const Nickels As Integer = 0.05
Const Dimes As Integer = 0.1
Const Dollar As Integer = 1.0
Cash = Val(txtChange.Text)
If Cash Mod Quarters = 0 Then
Me.lblQuarters.Text = Dollar / Quarters
ElseIf Cash Mod Dimes = 0 Then
Me.lblDimes.Text = Dollar / Dimes
ElseIf Cash Mod Nickels = 0 Then
Me.lblNickels.Text = Dollar / Nickels
ElseIf Cash Mod Pennies = 0 Then
Me.lblPennies.Text = Dollar / Pennies
End If
End Sub
Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click
Me.Close()
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
End Sub
End Class
Private Sub btnChange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnChange.Click
Dim Cash As Integer
Const Pennies As Integer = 0.01
Const Quarters As Integer = 0.25
Const Nickels As Integer = 0.05
Const Dimes As Integer = 0.1
Const Dollar As Integer = 1.0
Cash = Val(txtChange.Text)
If Cash Mod Quarters = 0 Then
Me.lblQuarters.Text = Dollar / Quarters
ElseIf Cash Mod Dimes = 0 Then
Me.lblDimes.Text = Dollar / Dimes
ElseIf Cash Mod Nickels = 0 Then
Me.lblNickels.Text = Dollar / Nickels
ElseIf Cash Mod Pennies = 0 Then
Me.lblPennies.Text = Dollar / Pennies
End If
End Sub
Private Sub btnQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnQuit.Click
Me.Close()
End Sub
Private Sub btnClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClear.Click
End Sub
End Class
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb VB.NET Marketplace
- NEED Help? Cash Register modules (Computer Science and Software Design)
- C++ Cash Register - Help Getting Started (C++)
- Small Help Needed, Almost Done (Java)
- simple cash register (pos) problem - please help!! (VB.NET)
- Urgent help needed (Pascal and Delphi)
Other Threads in the VB.NET Forum
- Previous Thread: Using Windows XP Visual Styles with Controls on Windows Forms
- Next Thread: Calculate Averages for a Class program


Linear Mode