>how can i consider each cases ?
By understanding them. If you don't understand what's going on then you clearly can't tell the computer how to do it. If you do understand what's going on, you can make such connections as realizing that -25-(-30) is actually the same as -25+30, you can move toward the sign of the second operand, and that the difference between negative and positive is the same as setting a flag and reversing direction when you hit 0.
Beyond that it's the same old basic arithmetic that you learned in the first grade.
The CBI surveyed more than 500 companies with 1.1million employees. They found that 52% of employers are dissatisfied with the basic literacy of school leavers and 50% with their basic numeracy, but 92% are satisfied with their IT skills. Half of employers said some teenagers were ‘unable to function in the workplace’ claiming they cannot make simple calculations in their heads, speak in an articulate manner or understand written instructions.
What's 92% measuring?
"Has the ability to switch the machine on, and move the mouse without strangling themselves with the cord".
public class GrossmontBank
//class variables (global - accessible throughout this class)
//scanner object to be used throughout
private static Scanner input = new Scanner(System.in);