subject

Write a java class named numberconverter that provides methods to accept strings of binary, octal or hexadecimal numbers and converts them to the decimal equivalent string. the class should provide the methods binaryconverter, octalconverter and hexadecimalconverter. the method binaryconverter parses an input string of a binary number and converts it to a string representation of the decimal equivalent. the method octalconverter parses an input string of an octal number and converts it to the decimal equivalent string. the method hexadecimalconverter parses an input string of a hexadecimal number and converts it to the decimal equivalent string. in the implementation of each method, include an exception handler to throw an exception if the input string is not in the proper format for the appropriate number in java. if the number is correctly formatted, return the string representation of the decimal conversion, otherwise return the message the exception handler generates. ensure that the input numbers only include the digits appropriate for the base. the exceptions your methods create must keep track of the first illegal character that occurred in the string and report its position and the character itself. include an appropriate text message indicating why the exception was thrown. in java, binary numbers begin with a 0, are followed by an upper or lower case ‘b’ and only consist of the digits 0 and 1. octal numbers begin with a 0 and only consists of the digits 0 through 7.

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 01:30, chastineondre7979
How will you cite information that is common knowledge in your research paper?
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, jackie0833
Which option allows you to view slides on the full computer screen?
Answers: 1
image
Computers and Technology, 24.06.2019 14:30, ari313
Two students are discussing the flow of electricity. student a says that voltage is a measure of the amount of electron flow in a circuit. student b says that power is the product of voltage and current. which of the following statements is correct? a. only student a is correct b. only student b is correct c. both of the two students are correct d. neither of the two students is correct
Answers: 1
image
Computers and Technology, 24.06.2019 23:30, clairajogriggsk
What is the opening page of a website called? a. web page b. landing page c. homepage d. opening page
Answers: 1
You know the right answer?
Write a java class named numberconverter that provides methods to accept strings of binary, octal or...

Questions in other subjects: