need ur help. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

need ur help.

Waheed AkbarWaheed Akbar Posts: 6Member
Dear Members I want to make such a digital calculator which has the description:


On the basis of users choice, calculate the arithmetic (Addition & Subtraction) expression given by user.

1.Decimal Mode
2.Binary Mode
3.Octal Mode
4.Hexadecimal Mode

Its mean that in every mode we are capable to make addition and subtraction but just for that specific mode which has to be called.

Comments

  • tom_swtom_sw Posts: 828Member
    : Dear Members I want to make such a digital calculator which has the description:
    :
    :
    : On the basis of users choice, calculate the arithmetic (Addition & Subtraction) expression given by user.
    :
    : 1.Decimal Mode
    : 2.Binary Mode
    : 3.Octal Mode
    : 4.Hexadecimal Mode
    :
    : Its mean that in every mode we are capable to make addition and subtraction but just for that specific mode which has to be called.
    :
    :
    I would suggest that you just use the common math functions (decimal) for that actual operations. The mode will simply translate the current values from the indicated mode to decimal.

    For example, if the mode is Binary, you input a string, then feed that to a function that returns the decimal value of that binary string. Perform the indicated math function on that value. Then feed the resultant decimal value to another function that will transform the value to a binary string adn write that string to the result line or window.

    Have other functions to do the transformations from/to hex and octal as well - or make your functions generic with a flag for the type of transform to perform.
Sign In or Register to comment.