Question: This exercise is the programing exercise 9 from chapter 6 of the book java programming Design and implement a GUI program to convert a positive

This exercise is the programing exercise 9 from chapter 6 of the book java programming

Design and implement a GUI program to convert a positive number given in one base to another base. For this problem, assume that both bases are less than or equal to 10. Consider the sample data:

number=2010, base=3, new base=4

In this case, first convert 2010 in base 3 into his equivalent number in base 10 as follows:

2 * 3^3 + 0 * 3^2 + 1*3+0= 54+0+3+0=57

To convert 57 to base 4, you need to find the remainders obtained by dividing by 4, as shown in the following:

57%4=1 , quotient 14

14%4=2, quotient 3

3%4=3, quotient 0

Therefore, 57 in base 4 is 321.

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 Databases Questions!