Saturday, December 17, 2011
Making a java base conversion program and i'd like some help?
Hello, I'm currently working on a java program wherein the user will input their chosen number, its current base, and the desired base output then program will of course convert it to that and output the number in its new base. I have it figured out for the most part but I was wondering if anyone could give me some tips or show me how to use base 16 since it involves letters. i was thinking about usin tokenizer to go through the string and replace all the letters with their numerical value then proceed to the conversion as normal but that seems impractical with double digit numbers. Also it currently only accepts numbers in the base 10 format, how would you recommend that i go about implementing the other bases as a choice for format. My current idea for this is have them input the number and its current base, convert that to base 10, then run it through the program properly, but again this seems very impractical and difficult to do. If anyone could show me an example program that does this or just give me some pointers I'd really appreciate it.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment