Computers and Technology

Write a program using any high level language (Java, to help you convert from binary, octal, hexadecimal and decimal numbers. Your program would • ask the users to enter a number in binary or decimal
• ask the users what type of number it is (binary or decimal)
• check to make sure the number is legal (a decimal number contains only 0-9).
If the number is not legal, it should error out! If the number is legal, convert the number to the other 3 types
To challenge yourself, your program should also handle floating numbers although this step is NOT required.
NOTE: As always, properly document your program. Add in headers. Add in comments.
You CANNOT use pre-defined built in functions to do the conversion such as the followings and others!!
Integer. toString(n,8) // decimal to octal
Integer. toString(n,2)// decimal to binary
Integer. toString(n,16) //decimal to Hex
Your program needs to mimic the algorithm. Use the division/multiplication method.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 14:00, mpete1234567890
Var add = function( x, y ) { return ( x + y ); } alert( add (5, 3) ); 11. (refer to code example 2.) the function a. accepts 2 parameters and returns 2 values. b. accepts 2 parameters and returns 1 value. c. accepts 2 parameters and does not return a value. d. does not accept a parameter and returns 1 value.
Answers: 1
image
Computers and Technology, 22.06.2019 18:30, lizz1228
Kto rozmawia z clamentain przez krótkofalówke w the walking dead w 4 epizodzie
Answers: 1
image
Computers and Technology, 23.06.2019 09:20, lovely222
How to print: number is equal to: 1 and it is odd number number is equal to: 2 and it is even number number is equal to: 3 and it is odd number number is equal to: 4 and it is even number in the console using java using 1 if statement, 1 while loop, 1 else loop also using % to check odds and evens
Answers: 3
image
Computers and Technology, 23.06.2019 18:30, milkshakegrande101
Where can page numbers appear? check all that apply. in the header inside tables in the footer at the bottom of columns at the top of columns
Answers: 1
Do you know the correct answer?
Write a program using any high level language (Java, to help you convert from binary, octal, hexadec...

Questions in other subjects:

Konu
Mathematics, 08.09.2021 08:00
Konu
Spanish, 08.09.2021 08:00