-
February 28th, 2014, 07:04 PM
#1
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
-
February 28th, 2014, 08:26 PM
#2
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)
-
February 28th, 2014, 09:37 PM
#3
Re: Programming assignment help
Thanks, That really helped. I love this site.
-
March 21st, 2025, 06:00 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|