Question: Instructions: Write a program that reads the contents of the adjacent file: BinaryNumbers.txt and converts each number, one per line, to their decimal equivalent. In
Instructions: Write a program that reads the contents of the adjacent file: BinaryNumbers.txt and converts each number, one per line, to their decimal equivalent. In addition:
a Write the binDecString binaryString method to convert a binary string into a decimal number.
b Implement the binDec method to throw a NumberFormatException if the string is not a binary number.
c If the method throws an exception, display "Not a binary number", followed by the input string, as shown below.
Sample Program Output:
Please note:
You may only use material covered in this course so far
Programs with syntax errors will not be accepted
Grading Criteria:
Program Module Description:
Following Course Coding Conventions:
Correct implementation of trycatch blocks, per above instructions:
Output formatting matches examples:
Accuracy of results:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
