View Single Post
  #8   Spotlight this post!  
Unread 15-04-2008, 14:52
Dave Scheck's Avatar
Dave Scheck Dave Scheck is offline
Registered User
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Feb 2003
Rookie Year: 2002
Location: Arlington Heights, IL
Posts: 574
Dave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond reputeDave Scheck has a reputation beyond repute
Re: C Programming Homework Help Needed

I think you're missing the point of those that posted above. Yes, there are people on these boards that could write your program for you in less time than it would take to state the problem, but how is that going to help you as a student? When it comes to learning how to program, I guarantee you that the best way to learn is to struggle through the homework and ask appropriate questions to aid your learning.

The main problem that I see with your approach is that you're looking at the problem as a whole and trying to solve it as a whole. If you were given a large algebra problem like 2x + (x - 4) / x = 3y - x + 2 and were told to solve for y when x was 4, how would you do it? Probably in steps right?

You should treat your assignment the same way. So what steps/things do you have to do to complete your assignment?
1. Get an input from the user
2. Determine if the number can be processed
3. If the number can be processed, process it
3a Convert the number to binary
3b Print out the result
4. If the number is 0, print then exit your program

The best advice that I can give when you're given an overwhelming problem is to write a little bit, test, fix what's broken, retest, and repeat until the whole problem is done.

Try writing a program that first does step 1. Then add on step 2 (you can use prints to let you know whether the number will be processed or not). Then add step 4 (skipping 3 for now). Then add steps 3 and 3b. Notice that I left the hard stuff (binary conversion) until the end. Once your program has the framework to do everything but the binary conversion, add that in.

It really isn't as hard as you think it is. Think through the problem piece by piece and I'm sure that you'll be able to work through it.

If you run into problems, ask specific questions other than "this is my problem, please give me the answer" and I'm sure that you will be more likely to get the appropriate help.