Day 2: Number Systems


Exercise

Write a Java program to convert decimal to various other number systems.

Introduction

A number system is a method of representing numerical values using a set of symbols. Everybody is familiar with decimal which uses the symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9. A number system can be based on any collection of symbols with at least two symbols. The following are some common number systems and the symbols they use:

Number System Symbols used
Binary 0, and 1
Octal 0, 1, 2, 3, 4, 5, 6, and 7
Hexadecimal 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, and f

Algorithm

  1. Read a tutorial on number systems if you are not familiar with the process for converting between number systems.
  2. Implement the core functionality using a text-based interface for I/O.
  3. Build a GUI to wrap your implementation.

Resources

Hints


Return Home