Skip to content

DanielG-H/base

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

- Base Converter -

Motivation

To create a simple base converter between the binary, decimal, hexadecimal and octal bases. The most common and used ones.

Expected Output

The expected results are three conversions to the base to which the number to be converted corresponds.

At the same time, a "invalid base" message will pop-up every time a base not included is entered and the option to try to enter a new number will be displayed.
The binaries can only be composed of ones and zeroes, the hexadecimals of the numbers 0-9 and the letters AF (representing the numbers 10-15), the octals can only be composed of numbers 0-7 and the decimals can only have numbers from 0-9.

How does it work?

An iteration through each character of the input string to validate if the number is appropriate to the base

and a convertion from string to integer to make the calculations, using decimals to make the process between bases much easier.