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

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:10
1. declare a constant named cents_per_pound and initialize with 25. 2. get the shipping weight from user input storing the weight into shipweightpounds. 3. using flat_fee_cents and cents_per_pound constants, assign shipcostcents with the cost of shipping a package weighing shipweightpounds.
Answers: 2
question
Computers and Technology, 22.06.2019 16:10
Drag each label to the correct location on the imagelist the do’s and don’ts of safeguarding your password.keep yourself loggedin when you leave your computer.don’t write your password down and leave it whereothers can find it.share your password with your friends.each time you visit a website,retain the cookies on your computer.use a long password with mixed characters.
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
In my email i got a message it says a quick message and in message details on who its from its says nicole and under nicole is [email protected] -
Answers: 1
question
Computers and Technology, 23.06.2019 03:30
Hashtags serve to identify the topic of a given tweet true false
Answers: 2
You know the right answer?
Write a java class named numberconverter that provides methods to accept strings of binary, octal or...
Questions
question
Social Studies, 09.08.2021 08:10
question
Medicine, 09.08.2021 08:10
question
Business, 09.08.2021 08:10
Questions on the website: 13722361