Sorting Eggs with VB... HELP PLEASE

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jryanfallon
    New Member
    • Feb 2008
    • 3

    Sorting Eggs with VB... HELP PLEASE

    I am trying to write a program to sort eggs, extra eggs are discarded
    the program must have a pop up box for enter the eggs

    box type
    extra large - 12 dozen (144 eggs)
    large - 6 dozen (72 eggs)
    medium - 3 dozen (36 eggs)
    small - 1 dozen (12 eggs)

    example output picture box

    given total number of eggs: 952

    XL boxes required: 6
    L boxes requried: 1
    M boxes requried: 0
    S boxes requried: 1
    Left over discarded Eggs: 4

    wouldnt mind having a pop up box saying "would u like to discard extra eggs?"

    i think u need to write loops which enter the count for u and work from the 1st inported value
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    What version of VB are you working with? And how far along are you in building this?

    The overall techynique is probably to start with your total number of eggs and do a loop through each of the box types, starting from the largest. Each time around the loop, some variation on Int(TotalEggsLe ft / BoxCapacity) will give you the number of boxes required. Then you subtract the number of eggs catered for, and loop around again.

    Comment

    • jryanfallon
      New Member
      • Feb 2008
      • 3

      #3
      i am working with the newest vb i think... im not to sure how to use a loop is the problem.. i understand kinda... but when i have to take it from the popup box i get lost

      Comment

      • debasisdas
        Recognized Expert Expert
        • Dec 2006
        • 8119

        #4
        Originally posted by jryanfallon
        i am working with the newest vb i think...
        You don't know which version of VB you are working on ?

        Do you know what are you doing ?

        Comment

        • jryanfallon
          New Member
          • Feb 2008
          • 3

          #5
          im using vb 6.0

          i do know what i am doing... i kinda understand loops ... i dont know how to use the entered value in popup box into the loop

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Just a quick note. VB6 (which I use and like) is over 10 years old, and at least 3 versions behind. So "latest" is probably not entirely accurate.

            Could you show us what you've written so far?

            Comment

            Working...