Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

decimal to binary converter - java

Thread view: 
sam20e - 03 Jul 2007 18:33 GMT
hi i need a help... i wanna write a java programmee to display the
binary number of the entered decimal number.

for ex : in t text area u should type a desimal number and press
"Convert" button to display its binary in the next txt field

need help mates, i need to write a programme.. i need the "JAVA CODES"

p.s : should use only 1 statement; stack
John W. Kennedy - 03 Jul 2007 18:58 GMT
> hi i need a help... i wanna write a java programmee to display the
> binary number of the entered decimal number.
[quoted text clipped - 5 lines]
>
> p.s : should use only 1 statement; stack

Do your homework yourself. If, after having made a reasonable effort,
you find yourself stuck, come back.
Signature

John W. Kennedy
If Bill Gates believes in "intelligent design", why can't he apply it to
Windows?

Sideswipe - 03 Jul 2007 19:18 GMT
Although he should be doing his homework himself, this is a simple
implementation trick. I would prefer he not be discouraged by
newsgroup trolls and focus his emphasis in learning on design. After
all, what I am about to show him he could eventually find, but no
amount of documentation is going to get him to design good code.

Integer.toString(input,2); // just 1 example

Please see all the "toString" methods of Integer. There are several
ways to do it right there.

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Integer.html

Christian Bongiorno

http://christian.bongiorno.org
~kurt - 04 Jul 2007 02:42 GMT
> Although he should be doing his homework himself, this is a simple
> implementation trick. I would prefer he not be discouraged by

What, are you one of those bleeding hearts who is in the process of
destroying our educational system by doing everything that can be done
to protect our children's fragile egos?  Boo hoo hoo....

> newsgroup trolls and focus his emphasis in learning on design. After

Design is part of writing software - knowing the details can affect
design.  Going through the exercise of figuring out this problem
is more important - he'll get pleny of opportunities to learn design.

> all, what I am about to show him he could eventually find, but no

So, he could have learned how to find things instead?  What is that
saying about giving a man a fish vs. teaching a man how to fish?
All you are teaching him is to go to Usenet for all his thinking.

> amount of documentation is going to get him to design good code.

This probably wasn't a design class.  It looked like a classic hw problem
to me.

- Kurt


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.