Welcome to Dream.In.Code
Become a VB.NET Expert!

Join 150,072 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,787 people online right now. Registration is fast and FREE... Join Now!




Pennies Calculator

 
Reply to this topicStart new topic

Pennies Calculator, troubles with arithmetic

r10lover10
4 Feb, 2008 - 10:08 AM
Post #1

New D.I.C Head
*

Joined: 26 Nov, 2007
Posts: 32


My Contributions
The pennies calculator is suppose to divide the amount of pennies enter in an input box and display in dollars, quarters, dimes, nickels, and pennies.
I am able to convert it to dollars by / 100. However, I am stuck at using the remainder to continue the arithmetic.
Here is my code

CODE
        str1 = InputBox("Input the quantity of pennies")
        Debug.Write("Dollars =" & Integer.Parse(str1) / 100)
        Debug.Write("Quarters =" & Integer.Parse(str1) / 100 Mod / 25)
        Me.Visible = Boolean.Parse("True")

Debug.Write("Quarters =" & Integer.Parse(str1) / 100 Mod / 25) It is my attempt but it is not working.

help is appreciated.
User is offlineProfile CardPM
+Quote Post

Jayman
RE: Pennies Calculator
4 Feb, 2008 - 10:22 AM
Post #2

Student of Life
Group Icon

Joined: 26 Dec, 2005
Posts: 7,319



Thanked: 66 times
Dream Kudos: 500
Expert In: Everything

My Contributions
Once you have divided by a number, then do a Mod with that same number to find the remainder. And then move onto the next division.
CODE
Debug.Write("Quarters =" & (Integer.Parse(str1) Mod  100) / 25)

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 11:02PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month