Greetings Everyone :)

I am an electrical engineering student enrolled in a course for C++ with no prior experience in programming. Our instructor gave my class an assignment to make a C++ program to convert a decimal number to a binary number. This seems like a pretty complex assignment, since he hasn't taught us much thus far. I've been looking through our text book and my notes and feel a bit overwhelmed. Can somebody help me out and instruct me through what exactly I need to do? I don't want just straight up answers, I want to learn and understand. Is there anyone out there that can help me?

Thank you :)

-Jessica
Last edited on
Well, first you should write down step by step how you would do it when using just pen and paper.
Then you should try to turn each of these steps into C++ code.
Hello, Jessica.

I'm assuming that your course is not for beginners, since your assignment involves decimal to binary conversions.

I've found this two-part video that explains how to convert decimal to binary.

Part 1: http://www.youtube.com/watch?v=qWxiXU02ZQM
Part 2: http://www.youtube.com/watch?v=UUqtjb8WEUs
I have prior experience on the actual number conversions, just not any experience with programming :-/ I have all the math written down on paper... but I am at a loss about how to put it into C++ language.

Thanks for your reply, Athar & AWH!
Last edited on
Here's a useful link for you, Jessica: http://www.softwareandfinance.com/Visual_CPP/Decimal_to_Binary.html . It provides a sample source code snippet which is easy to follow. Combining your knowledge of number conversions and the source code within the link, you'll ace the assignment.

Good luck :)
Wow! That's crazy! You must have been in an advanced C++ class. Make sure you're taking 'Introduction to C++'
... the C++ class I am taking is indeed the introduction course. I don't think the instructor (who is my age... 23) knows how to teach the course at an extremely basic level. I'm sure he knows the subject matter well, but can't relate to students in the same situation I am in. I am trying to make the best of it.

Thank you for your replies and posted links to help me :)
Topic archived. No new replies allowed.