akneelanjan / Neelanjan_Task2

KRSSG Task 2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Neelanjan_Task2

Number System with different bases

This program is capable of addition, multiplication, division and finding difference of integers alongwith interconverion of systems;

irrespective of any base (3-9 in addition to 2, 8, 10, 16 i.e. Binary to Decimal plus Hexadecimal)

Features

  • You can use all bases from 2 to 10 and 16.
  • It is also capable of interconversion of number systems among bases.
  • It points out extraneous errors - like if a binary input by user includes 2 it shows invalid input.
  • It uses a base class system called "Number"; and derives or inherits all number systems from it through a generalised code of basic arithmetic operations.
  • It doesn't need to convert numbers in other bases to decimal for calculation (except in division). The program is thus capable of base-independent addition, multiplication etc. (For eg. - program has learnt binary addition, binary difference, binary multiplication as it follows general arithmetic principles of carry-over, borrow etc.).
  • It has a menu-driven continuous looping program. Initial base selection menu contains only Decimal, Binary, Octal and Hexadecimal; but if you input a different number other than 2, 8, 10, 16; suppose 3 then it enters the new base mode i.e. Ternary Numeral System and becomes fully compatible with all above operations.
  • While printing answers, it consumes leading zeroes thus making the answer look nice to view. Also, hexadecimal outputs (string in nature) have been implemented.
  • Restrictions of this program: Floating point number arithmetic not implemented.

About

KRSSG Task 2


Languages

Language:C++ 100.0%