AJAY CHADHA
asked on
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 .. :-)
Good Luck...
Ajay Chadha .. :-)
Sorry, doing peoples homework is not permitted on ee.
ASKER
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
Please send the working sourece code
Then ask specific questions about solving your problem.
'Please supply working code' is not a question.
Have a look at the method Integer.toHexString().
'Please supply working code' is not a question.
Have a look at the method Integer.toHexString().
ASKER
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 .. :-)
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 .. :-)
ASKER
I need detailed description of Integer.toHexString() with a sample code.
Ajay Chadha ... :-)
Ajay Chadha ... :-)
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.
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.
ASKER
Hello ozymandias,
I'm unable to find them out.
Please email them to me at ajay@chadhaajay.net
I'm unable to find them out.
Please email them to me at ajay@chadhaajay.net
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
Cheers,
Kylar
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(myI nt); //convert to binary
System.out.println(HexInt) ; // should give 19 Hex
System.out.println(BinInt) ; // should give 11001 binary
}
}
//Converter//
public class Converter {
public static void main(String s[]) {
int myInt = 25; //number to convert
String HexInt = Integer.toHexString(myInt)
String BinInt = Integer.toBinaryString(myI
System.out.println(HexInt)
System.out.println(BinInt)
}
}
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.
And in fact code was already provided by ozymandias.
I wasn't dissing the experts, I was just complaining about the points and the matter the question was asked to chadhaajay. :o)
understood :)
ASKER