Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Number to HEX Conversion

Posted on 2001-07-05
15
Medium Priority
?
462 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
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

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

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
Suggested Courses

688 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