subject

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.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 23.06.2019 19:00
This question involves a class named textfile that represents a text file. public class textfile { private string filename; private string filename; private arraylist words; // constructors not shown // postcondition: returns the number of bytes in this file public int filesize() { } // precondition: 0 < = index < words.size() // postcondition: removes numwords words from the words arraylist beginning at // index. public void deletewords(int index, int numwords) { } // precondition: 0 < = index < = words.size() // postcondition: adds elements from newwords array to words arraylist beginning // at index. pub lic voidaddwords(int index, string[] newwords) { } // other methods not shown } complete the filesize() method. the filesize() is computed in bytes. in a text file, each character in each word counts as one byte. in addition, there is a space in between each word in the words arraylist, and each of those spaces also counts as one byte. for example, suppose the words arraylist stores the following words: { mary had a little lamb; its fleece was white as snow. } the filesize() method would compute 4 + 3 + 1 + 6 + 5 + 4 + 6 + 3 + 5 + 2 + 5 as the sum of the lengths of each string in the arraylist. the value returned would be this sum plus 10, because there would also be 10 spaces in between the 11 words. complete the filesize() method below: // postcondition: returns the number of bytes in this file public int filesize() { }
Answers: 1
question
Computers and Technology, 23.06.2019 22:40
22. sata3 allows for data transfer rates of 600 mb/s. explain why you would likely not be able to copy data from one hard drive to another at anywhere close to this speed. also, what could be upgraded on the computer to achieve transfer speeds closer to 600 mb/s
Answers: 1
question
Computers and Technology, 24.06.2019 08:00
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
Answers: 1
You know the right answer?
Write a program using any high level language (Java, to help you convert from binary, octal, hexadec...
Questions
question
Mathematics, 15.12.2020 01:00
question
Biology, 15.12.2020 01:00
question
Biology, 15.12.2020 01:00
question
Mathematics, 15.12.2020 01:00
question
Arts, 15.12.2020 01:00
question
Mathematics, 15.12.2020 01:00
question
Mathematics, 15.12.2020 01:00
question
History, 15.12.2020 01:00