Question
I need to build a number conversion calculator that has a GUI . It converts numbers between hex, binary, octal and decimal. The calculator has
I need to build a number conversion calculator that has a GUI . It converts numbers between hex, binary, octal and decimal. The calculator has to perform arithmetics such as (+,-,*,/) as well. I do not want to use any python built in library , i need a clear shown step by step conversion. I've only managed to do a step by step conversion of decimal to binary.. and am pretty lost here ... Unable to use builtin python conversion functions and needs to show the steps is whats hard about this. can someone help me. The attached photo is how i want my gui to kinda look like
Python : dec to binary def main(): #get input from user n = int(input("Enter a decimal number:")) #print output print("{0} in decimal = {1} in binary".format(n,DecToBin(n))) return 0
def DecToBin(n): binaryNumber = 0;remainder = 1;i=1;step=1; while(n!=0): #get remainder remainder = n%2 print("Step{0}:{1}/2,Quotient={2},Remainder ={3} ".format(step, n,int(n/2),remainder)) #increment step += 1 #get integer part of n/2 n = int(n/2) #add remainder to binaryNumber binaryNumber += remainder * i i *= 10 return binaryNumber
main()
Dec Hex + Oct Bin DEL 9 ACStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started