Solved

Number to HEX Conversion

Posted on 2001-07-05
15
457 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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
 
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This video teaches viewers about errors in exception handling.
Suggested Courses

622 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