Skip to content

A Java program to convert numerals to differnt bases such as binary, decimal, octal, and hexadecimal

License

Notifications You must be signed in to change notification settings

dchid/Numeral-Base-Converter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Numeral-Base-Converter

A Java program to convert numerals to differnt bases such as binary, decimal, octal, and hexadecimal. This is mostly intended for use as a development tool rather than a standalone application. One might find it useful for say, making a programer's calculator or piping this program's output into another program.

Dependancies

Download the most recent Java Development Kit (JDK)

Installation (Linux or Mac)

Download or clone the repo and cd into the directory

git clone https://github.com/dchid/Numeral-Base-Converter.git
cd Numeral-Base-Converter
javac NumeralBaseConverter.java

Use

This program takes a numberal in bases 2 through 16 and converts it into a user specified number base. Before the program is used, it must be compiled. The syntax for using the program is "java NumeralBaseConverter numeral input_base output_base".

  • Example 1:

    • Input: numeral="42" input_base=10, output_base=2
    • Output: "101010" java NumeralBaseConverter 42 10 2
  • Example 2:

    • Input: numeral="11110" input_base=2, output_base=16
    • Output: 1E java NumeralBaseConverter 2 10 16

Base 16 input if case insensitive so 'f' and 'F' are both the same as far as the program's input is concerned

About

A Java program to convert numerals to differnt bases such as binary, decimal, octal, and hexadecimal

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages