Engineering
Engineering, 13.09.2019 01:10, Benysod402

Write a java class named numberconverter that provides methods to accept strings of binary or octal numbers and converts them to the decimal equivalent string. the class should provide the methods binaryconverter and octalconverter.
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.
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.

answer
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, lowkeyqueenk
Apipe with an outside diameter of 15 cm is exposed to an ambient air and surrounding temperature of -20Β°c. the pipe has an outer surface temperature of 65Β°c and an emissivity of 0.85. if the rate of heat loss from the pipe surface is 0.95 kw per meter of length, the external convective heat transfer coefficient (h) is: (a) 12.5 w/m"k (b) 18.6 w/mk (c) 23.7 w/mk (d) 27.9 w/mk (e) 33.5 w/mk
Answers: 1
image
Engineering, 04.07.2019 18:10, agpraga23ovv65c
Carbon dioxide gas expands isotherm a turbine from 1 mpa, 500 k at 200 kpa. assuming the ideal gas model and neglecting the kinetic and potential energies, determine the change in entropy, heat transfer and work for each kilogram of co2.
Answers: 2
image
Engineering, 04.07.2019 18:20, cristykianpour
Describe one experiment in which the glass transition temperature and melting temperature of a totally amorphous thermoplastic material can be determined. show the relevant experimental results in a diagram which should be properly annotated with the two temperatures clearly marked. what is likely to happen to the curve in the diagram if the amorphous polymer is replaced by a thermosetting type?
Answers: 2
image
Engineering, 04.07.2019 19:20, kaitlyn114433
Ashielded metal arc-welding operation is accomplished in a work cell by a fitter and a welder. the fitter takes 5.5 min to load components into the welding fixture at the beginning of the work cycle, and 1.5 min to unload the completed weldment at the end of the cycle. the total ength of the weld seams 1200 mm, and the travel speed used by the welder averages 300 mm/min. every 600 mm of seam length, the welding stick must be changed, which takes 0.8 min. while the fitter is working, the welder is idle (resting): and while the welder is working the fitter is idle. (a) determine the average arc-on time as a fraction of the work cycle time. (b) how much improvement in arc-on time would result if the welder used flux-cored arc welding (manually operated), given that the spool of weld wire must be changed every 10 weldments, and it takes the welder 5.0 min to accomplish the change? (c) what are the production rates for these two cases (weldments completed per hour)? attach your work and solutions.
Answers: 1
Do you know the correct answer?
Write a java class named numberconverter that provides methods to accept strings of binary or octal...

Questions in other subjects:

Konu
Chemistry, 23.05.2020 16:59