Question: Python (it has to be GUI ) Conversions between Hexadecimal numbers and decimal numbers. write a program in python that should ask (prompt) the user

Python (it has to be GUI)

Conversions between Hexadecimal numbers and decimal numbers. write a program in python

Conversions between Hexadecimal numbers and decimal numbers. write a program in python that should ask (prompt) the user for what to convert 1. Hex to decimal 2. Decimal to hex as a string validate. Then depend of the user's pick if 1 and it's a valid hax number then the program should read that hexadecimal number and convert it to decimal and print it. If the input contains characters that are not hexadecimal numbers, then an error message is printed. format given below Conversions Between Hexadecimal Numbers and Decimal Numbers Given a hexadecimal number hnhn-1hn-2... h2h1ho, the equivalent decimal value is hn x 16" + hn-1 X 16-1 + hn-2 X 16-2 + ... + h x 16 + h1 x 16 + ho x 16 The following are examples of converting hexadecimal numbers to decimals: Hexadecimal Conversion Formula Decimal 7F 7 x 161 +15 x 16 127 FFFF 431 15 x 163 + 15 x 162 + 15 x 161 + 15 x 16 4 x 162 + 3 x 161 + 1 x 16 65535 1073 To convert a decimal number d to a hexadecimal number is to find the hexadecimal digits hn, hn-1, hn-2, h2, h, and ho such that d = hn x 16" + hn-1 X 16-1 + hn-2 X 16"-2 + ... + h x 16 + h x 16 + ho x 16 These numbers can be found by successively dividing d by 16 until the quotient is 0. The remainders are ho, h1, h2r, h-2 hn-1, and hn.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!