Solved

Number to HEX Conversion

Posted on 2001-07-05
15
442 Views
Last Modified: 2010-04-16
Make a program that ask to Input a number and have it print out a hex and bin number

Good Luck...

Ajay Chadha .. :-)
0
Comment
Question by:AJAY CHADHA
  • 5
  • 5
  • 2
  • +2
15 Comments
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6257903
Please let me know if it requires more points.
0
 
LVL 92

Expert Comment

by:objects
ID: 6257971
Sorry, doing peoples homework is not permitted on ee.
0
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6257998
This is not a homework. Actually I'm an experienced Coder with expertise in VB. I'm learning Java and this is the problem I had.

Please send the working sourece code
0
 
LVL 92

Expert Comment

by:objects
ID: 6258032
Then ask specific questions about solving your problem.
'Please supply working code' is not a question.

Have a look at the method Integer.toHexString().
0
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6258538
Thanks objects ,

Could you please come out with a sample code as I don't know anything of Java.

I'll definitely increase ponits for a working solution. I'm learning Java.

Ajay Chadha .. :-)
0
 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6258540
I need detailed description of Integer.toHexString() with a sample code.

Ajay Chadha ... :-)
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6258816
There is a detailed decription on Integer.toHexString anmfd Integer.to BinaryString in the Java API Documentation. This is available to browse here :

    http://java.sun.com/j2se/1.3/docs/api/index.html

Look up the class String in the class list and then look at the Static methods toHexString and toBinaryString. If you are serious about learning Java you had better get used to reading this stuff. It is absolutely indispensable.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 8

Author Comment

by:AJAY CHADHA
ID: 6259296
Hello ozymandias,

I'm unable to find them out.

Please email them to me at ajay@chadhaajay.net
0
 
LVL 15

Accepted Solution

by:
ozymandias earned 13 total points
ID: 6259411
1. It is always worth checking the PAQ on EE before you ask a question. This question has been asked and answered recently. Look at my answer to this question. It is an application that does exactly what you have asked for. (http://www.experts-exchange.com/jsp/qShow.jsp?qid=20145130).

2. What problem are you having reading the API documentation ?
0
 
LVL 4

Expert Comment

by:kylar
ID: 6260119
Let me put it to you this way: if you are unable to understand the API documentations (which I think most experts will agree with me is the MOST valuable and used resource) Then you need to start at the beginning. Go out and buy a book about programming in Java. I would recommend Thinking In Java, 2nd Ed by bruce eckel, which is available online (www.bruceeckel.com) and start reading. When you understand enough to make sense of the documentation of the APIs, then come back to us with specific problems and difficulties.

Cheers,
Kylar
0
 

Expert Comment

by:scooter1
ID: 6261269
For 13 points nobody wants to write a proggie for ya !!!

//Converter//

public class Converter {
     
     
      public static void main(String s[]) {
           
           
           int myInt = 25; //number to convert
           
           String HexInt = Integer.toHexString(myInt);       //convert to hex
           String BinInt = Integer.toBinaryString(myInt);       //convert to binary
           
           System.out.println(HexInt); // should give  19     Hex
           System.out.println(BinInt); // should give  11001  binary
           
           
      }

     
}
0
 
LVL 92

Expert Comment

by:objects
ID: 6261285
I didn't here any complaining or even mentioning the number of points involved. I don't think that had anything to do with it.
0
 
LVL 92

Expert Comment

by:objects
ID: 6261290
And in fact code was already provided by ozymandias.
0
 

Expert Comment

by:scooter1
ID: 6261294
I wasn't dissing the experts, I was just complaining about the points and the matter the question was asked to chadhaajay. :o)
0
 
LVL 92

Expert Comment

by:objects
ID: 6261310
understood :)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now