CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2014
    Location
    California
    Posts
    4

    Programming assignment help

    Hi,

    I'm a programming student who's stuck on a seemingly simple assignment. I'm not looking for the answer, but a push in the right direction would be great. The assignment is to have 3 textboxes, and to have the program count 1-100, having the hundreds place show in textbox1, the tens place in textbox2, and the ones place in textbox3. Any advice and help would be well apprectiated.

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Programming assignment help

    Two ways. Count to 10 in each box and do them multiple times, or use the MODULO function and one counter (Mod)
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Feb 2014
    Location
    California
    Posts
    4

    Re: Programming assignment help

    Thanks, That really helped. I love this site.

  4. #4
    Join Date
    Feb 2025
    Posts
    2

    Re: Programming assignment help

    I had the exact same assignment, and I was stuck too! The trick is to break the number down into its place values using integer division (//) and modulus (%).

    For example, if you're looping from 1 to 100:

    The hundreds place can be found using num // 100
    The tens place can be found using (num // 10) % 10
    The ones place can be found using num % 10
    If you're using Python with a GUI like Tkinter, you can update each textbox with these values inside a loop.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured