Menu

[solved]-Create Method Java Setounces Strounces String Convert String Input Provided Integer Follow Q39010763

CREATE THIS METHOD IN JAVA:

  1. setOunces(strOunces: String) will convert theString input provided to an integer in the following manner:
  1. Your method will find every third single digit in strOunces.Ignore all characters that are not a digit. Do not worry aboutnegative numbers; the – will be considered a non-numeric characternot a digit. If no third single digits are found, you will defaultto 12.
  2. Invoke setOunces(ounces int).
  3. Examples:
    1. 03069858 will invoke setOunces(8). It is OKthat the 0 is dropped at the beginning of an integer and anotherfollows. If 0 is the only digit the ounces number will be 0.
    2. A3b3c9d3 will invoke setOunces(9)
    3. Ssssss6ssss0sssss1sssss0ssss0ss1 will invokesetOunces(11). It is not OK to drop the 0 in themiddle or end of a ounces
    4. Dafs;lkdf;lkfd will invoke setOunces(12).
    5. 123d44633s73ff9 will invokesetOunces(367).
    6. aaaabbb00 will invoke setOunces(12). There isno third digit.
    7. aaaabbb000 will invoke setOunces(0). 0 is thethird digit.

Expert Answer


Answer to CREATE THIS METHOD IN JAVA: setOunces(strOunces: String) will convert the String input provided to an integer in the fol… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *