I am doing Java with input statements that does math. Ex: how many apples on hand? Input 200. How many apples required on stock? 300. Then it returns a statement of 100 apples are needed on order. I need a line in the code to return a 0 if the variable is a negative number . Ex 500 apples on hand, 400 required in stock, 0 needed on order instead of -100 needed on order. I’ve attached the code I have so far. Everything works, no errors, but I don’t want it to return a negative number.
The work provided by the experts at homeworkspool.com are model papers for students and it should not be submitted as it is in their school, college, or university. Our crafted papers are strictly intended to help students on their grades
+1 (740) 470 2447