Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 466
  • Last Modified:

Number to HEX Conversion

Make a program that ask to Input a number and have it print out a hex and bin number

Good Luck...

Ajay Chadha .. :-)
0
AJAY CHADHA
Asked:
AJAY CHADHA
  • 5
  • 5
  • 2
  • +2
1 Solution
 
AJAY CHADHAAuthor Commented:
Please let me know if it requires more points.
0
 
objectsCommented:
Sorry, doing peoples homework is not permitted on ee.
0
 
AJAY CHADHAAuthor Commented:
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
objectsCommented:
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
 
AJAY CHADHAAuthor Commented:
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
 
AJAY CHADHAAuthor Commented:
I need detailed description of Integer.toHexString() with a sample code.

Ajay Chadha ... :-)
0
 
ozymandiasCommented:
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
 
AJAY CHADHAAuthor Commented:
Hello ozymandias,

I'm unable to find them out.

Please email them to me at ajay@chadhaajay.net
0
 
ozymandiasCommented:
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
 
kylarCommented:
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
 
scooter1Commented:
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
 
objectsCommented:
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
 
objectsCommented:
And in fact code was already provided by ozymandias.
0
 
scooter1Commented:
I wasn't dissing the experts, I was just complaining about the points and the matter the question was asked to chadhaajay. :o)
0
 
objectsCommented:
understood :)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 5
  • 5
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now