Hi
This semester I started learning Informatics as a subject and I am an absolute beginner. We have to do homework every week and this time I couldn't figure out, how eactly the task should be solved.
And the task is we have to round some numbers. If the number ist for example a double 3.14 or 0.49 - we have to round it down to an int 3 and an int 0, and if we have a number like 10.5 it should be rounded up to int 11.
We were told
NOT to use the Math.round method for this task and were also given the hint, that the task could be done in only one line of code.
Exactly the creating if the one line of code is the thing I cannot figure out. Does someone of you guys know an efficient solution to this problem? How can I convert both types of doubles in one and the same command?