Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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()

image text in transcribed

Dec Hex + Oct Bin DEL 9 AC

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genomes Browsers And Databases Data Mining Tools For Integrated Genomic Databases

Authors: Peter Schattner

1st Edition

0521711320, 978-0521711326

More Books

Students also viewed these Databases questions

Question

Statutes are a primary source of law. (True/False)

Answered: 1 week ago