473,395 Members | 1,885 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Simple Calculator to Convert Decimal to Hexadecimal

napster161
1st Question:
Correction: BINARY to HEXADECIMAL
I have write some simple code for this matter

Expand|Select|Wrap|Line Numbers
  1. public class DecimalToHexadecimal{
  2.   public static void main(String[] args) throws IOException{  
  3.     BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
  4.     System.out.println("Enter the decimal value:");
  5.     String hex = bf.readLine();
  6.     int i = Integer.parseInt(hex);
  7.     String hex1 = Integer.toHexString(i);
  8.     System.out.println("Hexa decimal: " + hex1);
  9.   }
  10. }
But i already got some error there,anyone??

2nd Question:
The different between java.util, java.lang, java.io

Thanks in advance :)
Feb 17 '10 #1
1 4910
Curtis Rutland
3,256 Expert 2GB
This is obviously a homework problem. I suggest you read our Posting Guidelines on Homework Questions.

So, all I can suggest for your second question is to consult your textbook or google.

For your first question, what error? Without detail, we cannot help.
Feb 17 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Mathieu Malaterre | last post by:
Hi, I tried a simple addition with python and I don't understand what is going on: $python >>464.73+279.78 744.50999999999999 weird isn't it ? I use python2.3.
5
by: Yodai | last post by:
Hi all! I have an int that comes with a value like 0x07fa and I have to turn it into a float value of 204.2 decimal to display it.... if I try to divide it by 10 I get bogus numbers. I presume...
9
by: FalkoG | last post by:
Hello colleague I want to convert a floating number for example 5236.9856982 to a hexadecimal number. I'd tried several things but my problem is to convert the position after decimal point. I...
6
by: MrKrich | last post by:
I want to convert Hexadecimal or normal integer to Binary. Does VB.Net has function to do that? I only found Hex function that convert normal integer to Hexadecimal.
13
by: muss | last post by:
how to convert decimal number in a hexadecimal number using C? Please help me. Thanks.
7
by: elliotng.ee | last post by:
I have a text file that contains a header 32-bit binary. For example, the text file could be: %%This is the input text %%test.txt Date: Tue Dec 26 14:03:35 2006...
6
by: sweeet_addiction16 | last post by:
hello Im writin a code in c... can sum1 pls help me out in writing a c code to convert decimalnumber to hexadecimal number.The hexadecimal number generated has to be an unsigned long.
10
by: cmdolcet69 | last post by:
Public ArrList As New ArrayList Public bitvalue As Byte() Public Sub addvalues() Dim index As Integer ArrList.Add(100) ArrList.Add(200) ArrList.Add(300) ArrList.Add(400) ArrList.Add(500)
6
by: i_robot73 | last post by:
I have a file, containing hex values for dates (MMDDYYYY)<status code><??such as: ...
8
by: sivadhanekula | last post by:
Hi everyone... I have a data with both decimal and Hexadecimal numbers. I am extracting the required data from for analysis with the help of MINITAB 15. The problem is MINITAB 15 is not accepting...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.