Can you annotate and create a flowchart. Can you also give description outlining which option chosen and a description of how it works and how to use it. def decimalToBinary(dec): if dec==0: return ''...



Can you annotate and create a flowchart.



Can you also give description outlining which option chosen and a description of how it works and how to use it.


def decimalToBinary(dec):


    if dec==0: return ''


    else:


        return decimalToBinary(dec//2) + str(dec%2)


def DecimaltoHex(n):


    x = (n % 16)


    characters = "0123456789ABCDEF"


    rest = n // 16


    if (rest == 0):


        return characters[x]


    return DecimaltoHex(rest) + characters[x]



n = eval(input('Enter a decimal integer: '))


print("Binary: ", decimalToBinary(n))


print("Hexadecimal: ", DecimaltoHex(n))



Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here