Write a method called subLR take a String number and return an integer that is the subtraction of left part and right part of the numbers. If the number has odd number of digits, then we ignore the...


Write a method called subLR take a String number and return an integer that is the<br>subtraction of left part and right part of the numbers. If the number has odd number<br>of digits, then we ignore the middle one.<br>Examples:<br>• subLR (

Extracted text: Write a method called subLR take a String number and return an integer that is the subtraction of left part and right part of the numbers. If the number has odd number of digits, then we ignore the middle one. Examples: • subLR ("123456") should return -333. Because left part is 123 and right part is 456, thus 123 - 456 = -333 • subLR ("92834") should return 58. Because left part is 92 and right part is 34 (we ignore 8 because of odd number of digits), thus 92 - 34 = 58 • subLR ("-123") should return -4. Because left part is -1 and right part is 3 (we ignore 2 because of odd number of digits), thus -1 - 3 = -4 subLR ("-345020") should return -365. Because left part is -345 and right part is 020, thus -345 - 20 = -365

Jun 01, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here